Search in sources :

Example 1 with II

use of org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.II in project ipf by oehf.

the class IiEqualFunction method handle.

@Override
public Object handle(Object... args) throws FunctionProcessingException {
    if (args.length != 2) {
        throw new FunctionProcessingException("Invalid number of parameters.");
    }
    try {
        var arg0 = (II) args[0];
        var arg1 = (II) args[1];
        return arg0.getRoot().equals(arg1.getRoot()) && arg0.getExtension().equals(arg1.getExtension());
    } catch (ClassCastException e) {
        throw new FunctionProcessingException("The arguments are of the wrong datatype", e);
    } catch (Exception e) {
        throw new FunctionProcessingException(e);
    }
}
Also used : II(org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.II) FunctionProcessingException(org.herasaf.xacml.core.function.FunctionProcessingException) FunctionProcessingException(org.herasaf.xacml.core.function.FunctionProcessingException)

Example 2 with II

use of org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.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 3 with II

use of org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.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 4 with II

use of org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.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)

Example 5 with II

use of org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.II in project webcert by sklintyg.

the class ConvertToFKTypesTest method testToIIExtNull.

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

Aggregations

II (iso.v21090.dt.v1.II)6 Test (org.junit.Test)3 FunctionProcessingException (org.herasaf.xacml.core.function.FunctionProcessingException)1 CD (org.hl7.v3.CD)1 II (org.hl7.v3.II)1 RCMRMT030101UK04CompoundStatement (org.hl7.v3.RCMRMT030101UK04CompoundStatement)1 TS (org.hl7.v3.TS)1 II (org.openehealth.ipf.commons.ihe.xacml20.stub.hl7v3.II)1