Package be.ehealth.businessconnector.chapterIV.builders.impl

# Class ConsultationBuilderImpl

java.lang.Object
be.ehealth.businessconnector.chapterIV.builders.impl.ConsultationBuilderImpl

All Implemented Interfaces:
  `ConsultationBuilder`, `ConfigurationModuleBootstrap.ModuleBootstrapHook`

public final class ConsultationBuilderImpl extends Object implements ConsultationBuilder, ConfigurationModuleBootstrap.ModuleBootstrapHook
A builder for the chapter IV consultation service. Implements : `ConsultationBuilder`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConsultationBuilderImpl()`
  default constructor, only needed for ModuleBootstrapHook.
  `ConsultationBuilderImpl(CommonBuilder commonBuilder)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `bootstrap()`
  `ChapterIVBuilderResponse`
  `build(FolderType folder, boolean isTest, ChapterIVReferences references, Instant agreementStartDate)`
  `ConsultChap4MedicalAdvisorAgreementRequest`
  `buildRequest(FolderType folder, boolean isTest, ChapterIVReferences references, Instant agreementStartDate)`
  `ConsultChap4MedicalAdvisorAgreementRequest`
  `buildRequest(FolderType folder, boolean isTest, String commonReference, String commonNIPReference, Instant agreementStartDate)`
  builds the `ConsultChap4MedicalAdvisorAgreementRequest` the folder should contain at least the following elements for the connector to work : the ids list in folder.patient.ids should contain at least one id.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ConsultationBuilderImpl

    public ConsultationBuilderImpl(CommonBuilder commonBuilder)

  - ### ConsultationBuilderImpl

    public ConsultationBuilderImpl()
    default constructor, only needed for ModuleBootstrapHook.

- ## Method Details

  - ### buildRequest

    public ConsultChap4MedicalAdvisorAgreementRequest buildRequest(FolderType folder, boolean isTest, String commonReference, String commonNIPReference, Instant agreementStartDate) throws ChapterIVBusinessConnectorException, TechnicalConnectorException
    Description copied from interface: `ConsultationBuilder`
    builds the `ConsultChap4MedicalAdvisorAgreementRequest` the folder should contain at least the following elements for the connector to work :
    - the ids list in folder.patient.ids should contain at least one id. for the agreementStartDate parameter utility method is proviced in `FolderTypeUtils` .retrieveConsultationStartDateOrAgreementStartDate(FolderType folder), if this value is null you need to provide the agreementStartDate yourself , following the chapterIV documentation
    Specified by:
      `buildRequest` in interface `ConsultationBuilder`
    Parameters:
      `folder` - `FolderType` contains the information to retrieve/send
      `isTest` - boolean indicating if this message is a test or not
      `commonReference` - String used to fill out commonReference field in CommonInput tag
      `commonNIPReference` - String used to fill out commonNipReference field in CommonInput tag
      `agreementStartDate` - not nullable : the agreementStartDate to be used in the request for the webservice : value : see documentation chapterIV
    Returns:
      ConsultChap4MedicalAdvisorAgreementRequest
    Throws:
      `ChapterIVBusinessConnectorException`
      `TechnicalConnectorException`
    See Also:
      - invalid reference

            be.ehealth.businessconnector.chapterIV.builders.ConsultationBuilder#buildRequest(be.fgov.ehealth.standards.kmehr.schema.v1.FolderType, boolean, java.lang.String, java.lang.String, String)

  - ### buildRequest

    public ConsultChap4MedicalAdvisorAgreementRequest buildRequest(FolderType folder, boolean isTest, ChapterIVReferences references, Instant agreementStartDate) throws ChapterIVBusinessConnectorException, TechnicalConnectorException
    Specified by:
      `buildRequest` in interface `ConsultationBuilder`
    Parameters:
      `folder` - `FolderType` contains the information to retrieve/send
      `isTest` - boolean indicating if this message is a test or not
      `references` - contains all the references needed by ChapterIV
      `agreementStartDate` - not nullable : the agreementStartDate to be used in the request for the webservice : value : see documentation chapterIV
    Returns:
      filled out ConsultChap4MedicalAdvisorAgreementRequest
    Throws:
      `ChapterIVBusinessConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `ConsultationBuilder.buildRequest(be.fgov.ehealth.standards.kmehr.schema.v1.FolderType, boolean, be.ehealth.businessconnector.chapterIV.domain.ChapterIVReferences, java.time.Instant)`

  - ### build

    public ChapterIVBuilderResponse build(FolderType folder, boolean isTest, ChapterIVReferences references, Instant agreementStartDate) throws ChapterIVBusinessConnectorException, TechnicalConnectorException
    Specified by:
      `build` in interface `ConsultationBuilder`
    Parameters:
      `folder` - `FolderType` contains the information to retrieve/send
      `isTest` - boolean indicating if this message is a test or not
      `references` - contains all the references needed by ChapterIV
      `agreementStartDate` - not nullable : the agreementStartDate to be used in the request for the webservice : value : see documentation chapterIV
    Returns:
      filled out ConsultChap4MedicalAdvisorAgreementRequest
    Throws:
      `ChapterIVBusinessConnectorException`
      `TechnicalConnectorException`
    See Also:
      - `ConsultationBuilder.build(be.fgov.ehealth.standards.kmehr.schema.v1.FolderType, boolean, be.ehealth.businessconnector.chapterIV.domain.ChapterIVReferences, java.time.Instant)`

  - ### bootstrap

    public void bootstrap()
    Specified by:
      `bootstrap` in interface `ConfigurationModuleBootstrap.ModuleBootstrapHook`