Search in sources :

Example 6 with II

use of org.hl7.v3.II in project integration-adaptor-111 by nhsconnect.

the class PatientMapper method getNhsNumberExtension.

private List<Extension> getNhsNumberExtension(II it) {
    Extension extension = new Extension(NHS_VERIFICATION_STATUS);
    Coding code = new Coding().setSystem(NHS_VERIFICATION_STATUS).setCode(mapNhsNumberVerificationStatus(it));
    extension.setValue(new CodeableConcept(code));
    return asList(extension);
}
Also used : Extension(org.hl7.fhir.dstu3.model.Extension) Coding(org.hl7.fhir.dstu3.model.Coding) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 7 with II

use of org.hl7.v3.II in project org.hl7.fhir.core by hapifhir.

the class InstanceValidator method buildIdentifierExpression.

private void buildIdentifierExpression(ElementDefinition ed, StringBuilder expression, String discriminator, Identifier ii) throws DefinitionException {
    if (ii.hasExtension())
        throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_IDENTIFIER_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
    boolean first = true;
    expression.append(discriminator + ".where(");
    if (ii.hasSystem()) {
        first = false;
        expression.append("system = '" + ii.getSystem() + "'");
    }
    if (ii.hasValue()) {
        if (first)
            first = false;
        else
            expression.append(" and ");
        expression.append("value = '" + ii.getValue() + "'");
    }
    if (ii.hasUse()) {
        if (first)
            first = false;
        else
            expression.append(" and ");
        expression.append("use = '" + ii.getUse() + "'");
    }
    if (ii.hasType()) {
        if (first)
            first = false;
        else
            expression.append(" and ");
        buildCodeableConceptExpression(ed, expression, TYPE, ii.getType());
    }
    if (first) {
        throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_IDENTIFIER_PATTERN_NO_PROPERTY_NOT_SUPPORTED_FOR_DISCRIMINATOR_FOR_SLICE, discriminator, ed.getId(), ii.fhirType()));
    }
    expression.append(").exists()");
}
Also used : DefinitionException(org.hl7.fhir.exceptions.DefinitionException)

Example 8 with II

use of org.hl7.v3.II in project webcert by sklintyg.

the class SendAnswerStubTest method createAnswer.

private SendMedicalCertificateAnswerType createAnswer(String message) {
    SendMedicalCertificateAnswerType parameters = new SendMedicalCertificateAnswerType();
    AnswerToFkType answerType = new AnswerToFkType();
    answerType.setFkReferensId("fkReferensId");
    answerType.setAmne(Amnetyp.OVRIGT);
    InnehallType fraga = new InnehallType();
    fraga.setMeddelandeText("fraga");
    fraga.setSigneringsTidpunkt(LocalDateTime.now());
    answerType.setFraga(fraga);
    InnehallType svar = new InnehallType();
    svar.setMeddelandeText(message);
    svar.setSigneringsTidpunkt(LocalDateTime.now());
    answerType.setSvar(svar);
    answerType.setVardReferensId("vardRef");
    answerType.setAvsantTidpunkt(LocalDateTime.now());
    LakarutlatandeEnkelType lakarutlatande = new LakarutlatandeEnkelType();
    lakarutlatande.setLakarutlatandeId("id");
    lakarutlatande.setSigneringsTidpunkt(LocalDateTime.now());
    PatientType patient = new PatientType();
    II id = new II();
    id.setRoot("1.2.752.129.2.1.3.1");
    id.setExtension("19121212-1212");
    patient.setPersonId(id);
    patient.setFullstandigtNamn("namn");
    lakarutlatande.setPatient(patient);
    answerType.setLakarutlatande(lakarutlatande);
    VardAdresseringsType vardAdress = new VardAdresseringsType();
    HosPersonalType hosPersonal = new HosPersonalType();
    II hosId = new II();
    hosId.setRoot("1.2.752.129.2.1.4.1");
    hosId.setExtension("hosId");
    hosPersonal.setPersonalId(hosId);
    hosPersonal.setFullstandigtNamn("hosPersonal");
    EnhetType enhet = new EnhetType();
    II enhetsId = new II();
    enhetsId.setRoot("1.2.752.129.2.1.4.1");
    enhetsId.setExtension("enhetsId");
    enhet.setEnhetsId(enhetsId);
    enhet.setEnhetsnamn("enhetsnamn");
    VardgivareType vardgivare = new VardgivareType();
    II vardgivarId = new II();
    vardgivarId.setRoot("1.2.752.129.2.1.4.1");
    vardgivarId.setExtension("vardgivarId");
    vardgivare.setVardgivareId(vardgivarId);
    vardgivare.setVardgivarnamn("vardgivarnamn");
    enhet.setVardgivare(vardgivare);
    hosPersonal.setEnhet(enhet);
    vardAdress.setHosPersonal(hosPersonal);
    answerType.setAdressVard(vardAdress);
    parameters.setAnswer(answerType);
    return parameters;
}
Also used : II(iso.v21090.dt.v1.II)

Example 9 with II

use of org.hl7.v3.II in project webcert by sklintyg.

the class ConvertToFKTypes method toII.

public static II toII(String root, String ext) {
    if (root == null || ext == null) {
        return null;
    }
    II ii = new II();
    ii.setRoot(root);
    ii.setExtension(ext);
    return ii;
}
Also used : II(iso.v21090.dt.v1.II)

Example 10 with II

use of org.hl7.v3.II in project webcert by sklintyg.

the class ConvertToFKTypesTest method testToIIRootNull.

@Test
public void testToIIRootNull() {
    II res = ConvertToFKTypes.toII(null, "ext");
    assertNull(res);
}
Also used : II(iso.v21090.dt.v1.II) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)10 II (net.ihe.gazelle.hl7v3.datatypes.II)9 CS (net.ihe.gazelle.hl7v3.datatypes.CS)8 TS (net.ihe.gazelle.hl7v3.datatypes.TS)8 Identifier (org.hl7.fhir.r4.model.Identifier)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7 BL (net.ihe.gazelle.hl7v3.datatypes.BL)7 CD (net.ihe.gazelle.hl7v3.datatypes.CD)7 CE (net.ihe.gazelle.hl7v3.datatypes.CE)7 INT (net.ihe.gazelle.hl7v3.datatypes.INT)7 MCCIMT000100UV01Device (net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Device)7 MCCIMT000100UV01Receiver (net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Receiver)7 MCCIMT000100UV01Sender (net.ihe.gazelle.hl7v3.mccimt000100UV01.MCCIMT000100UV01Sender)7 HumanName (org.hl7.fhir.r4.model.HumanName)7 PatientCommunicationComponent (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent)7 II (iso.v21090.dt.v1.II)6 COCTMT090003UV01AssignedEntity (net.ihe.gazelle.hl7v3.coctmt090003UV01.COCTMT090003UV01AssignedEntity)6 COCTMT090003UV01Organization (net.ihe.gazelle.hl7v3.coctmt090003UV01.COCTMT090003UV01Organization)6 COCTMT150003UV03ContactParty (net.ihe.gazelle.hl7v3.coctmt150003UV03.COCTMT150003UV03ContactParty)6 COCTMT150003UV03Organization (net.ihe.gazelle.hl7v3.coctmt150003UV03.COCTMT150003UV03Organization)6