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);
}
}
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;
}
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;
}
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);
}
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);
}
Aggregations