Search in sources :

Example 1 with INT

use of uk.nhs.connect.iucds.cda.ucr.INT in project integration-adaptor-111 by nhsconnect.

the class EncounterReportBundleServiceTest method setUp.

@BeforeEach
public void setUp() throws XmlException {
    INT versionNumber = mock(INT.class);
    when(versionNumber.getValue()).thenReturn(VERSION);
    when(document.getVersionNumber()).thenReturn(versionNumber);
    when(document.getEffectiveTime()).thenReturn(ts);
    when(ts.getValue()).thenReturn(EFFECTIVE_TIME);
    List<QuestionnaireResponse> questionnaireResponseList = new ArrayList<>();
    questionnaireResponseList.add(QUESTIONNAIRE_RESPONSE);
    when(deviceMapper.mapDevice()).thenReturn(DEVICE);
    when(encounterMapper.mapEncounter(any(), any(), any(), any())).thenReturn(ENCOUNTER);
    when(conditionMapper.mapCondition(any(), any(), any())).thenReturn(CONDITION);
    when(compositionMapper.mapComposition(any(), any(), any(), any(), any(), any())).thenReturn(COMPOSITION);
    when(listMapper.mapList(any(), any(), any(), any())).thenReturn(LIST_RESOURCE);
    when(carePlanMapper.mapCarePlan(any(), any(), any())).thenReturn(singletonList(CAREPLAN));
    when(healthcareServiceMapper.mapHealthcareService(any())).thenReturn(singletonList(HEALTHCARE_SERVICE));
    when(consentMapper.mapConsent(any(), any())).thenReturn(CONSENT);
    when(pathwayUtil.getQuestionnaireResponses(any(), any(), any())).thenReturn(questionnaireResponseList);
    when(messageHeaderService.createMessageHeader(any(), any(), eq(EFFECTIVE_TIME))).thenReturn(MESSAGE_HEADER);
    when(referralRequestMapper.mapReferralRequest(any(), any(), any(), any(), any())).thenReturn(REFERRAL_REQUEST);
    when(observationMapper.mapObservations(any(), eq(ENCOUNTER))).thenReturn(Arrays.asList(OBSERVATION));
    when(practitionerRoleMapper.mapAuthorRoles(any())).thenReturn(singletonList(AUTHOR_ROLE));
    when(practitionerRoleMapper.mapResponsibleParty(any())).thenReturn(Optional.of(PRACTITIONER_ROLE));
    when(relatedPersonMapper.createEmergencyContactRelatedPerson(eq(document), eq(ENCOUNTER))).thenReturn(RELATED_PERSON);
    when(deviceMapper.mapDevice()).thenReturn(DEVICE);
    Encounter.DiagnosisComponent diagnosisComponent = new Encounter.DiagnosisComponent();
    diagnosisComponent.setCondition(new Reference());
    diagnosisComponent.setRole(new CodeableConcept());
    diagnosisComponent.setRank(1);
    diagnosisComponent.setConditionTarget(CONDITION);
    ENCOUNTER.addDiagnosis(diagnosisComponent);
}
Also used : Reference(org.hl7.fhir.dstu3.model.Reference) ArrayList(java.util.ArrayList) Encounter(org.hl7.fhir.dstu3.model.Encounter) QuestionnaireResponse(org.hl7.fhir.dstu3.model.QuestionnaireResponse) INT(uk.nhs.connect.iucds.cda.ucr.INT) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ArrayList (java.util.ArrayList)1 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)1 Encounter (org.hl7.fhir.dstu3.model.Encounter)1 QuestionnaireResponse (org.hl7.fhir.dstu3.model.QuestionnaireResponse)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 INT (uk.nhs.connect.iucds.cda.ucr.INT)1