Java 类ims.clinical.vo.domain.AdmissionMedicationChangesVoAssembler 实例源码

项目:AvoinApotti    文件:HL7TTOIFImpl.java   
/**
* Impl for  TTO HL7 messages you finds the current I/P care context for the patient in the message (Note there will always be one open(no end/discharge date) I/P care context), then the MedicationDetails record for the care context and  replace the TTO coll
*/
public void setPatientCareContextTTORecord(ims.clinical.vo.PatientTTOIfVo patientTTOs)
{
    if(patientTTOs==null)
        throw new DomainRuntimeException("Message details are null, cannot process message");
    if(patientTTOs.getPatient()==null)
        throw new DomainRuntimeException("Patient details are null, cannot process message");

    DomainFactory factory = getDomainFactory();
    CareContext careContext = getOpenInPatientCareContext(patientTTOs.getPatient());
    if (careContext==null)
        throw new DomainRuntimeException("Open inpatient care context cannot be found for patient");
    MedicationDetails md = getMedicationDetailsFromCareContext(careContext);
    if (md==null)
        throw new DomainRuntimeException("Failed to get or create Medication Details record");

    md.getTTAs().clear();
    md.getAdmissionMedicationChanges().clear();
    Set<?> ttoFromMessage=TTODetailsIFVoAssembler.extractTTAMedicationSet(factory,patientTTOs.getTTOs() );
    md.getTTAs().addAll(ttoFromMessage);

    Set<?> medChanges=AdmissionMedicationChangesVoAssembler.extractAdmissionMedicationChangesSet(factory, patientTTOs.getMedicationChanges());
    md.getAdmissionMedicationChanges().addAll(medChanges);
    try {
        factory.save(md);
    } catch(StaleObjectException soe)
    {
        throw new DomainRuntimeException(soe);
    }
}
项目:openMAXIMS    文件:HL7TTOIFImpl.java   
/**
* Impl for  TTO HL7 messages you finds the current I/P care context for the patient in the message (Note there will always be one open(no end/discharge date) I/P care context), then the MedicationDetails record for the care context and  replace the TTO coll
*/
public void setPatientCareContextTTORecord(ims.clinical.vo.PatientTTOIfVo patientTTOs)
{
    if(patientTTOs==null)
        throw new DomainRuntimeException("Message details are null, cannot process message");
    if(patientTTOs.getPatient()==null)
        throw new DomainRuntimeException("Patient details are null, cannot process message");

    DomainFactory factory = getDomainFactory();
    CareContext careContext = getOpenInPatientCareContext(patientTTOs.getPatient());
    if (careContext==null)
        throw new DomainRuntimeException("Open inpatient care context cannot be found for patient");
    MedicationDetails md = getMedicationDetailsFromCareContext(careContext);
    if (md==null)
        throw new DomainRuntimeException("Failed to get or create Medication Details record");

    md.getTTAs().clear();
    md.getAdmissionMedicationChanges().clear();
    Set<?> ttoFromMessage=TTODetailsIFVoAssembler.extractTTAMedicationSet(factory,patientTTOs.getTTOs() );
    md.getTTAs().addAll(ttoFromMessage);

    Set<?> medChanges=AdmissionMedicationChangesVoAssembler.extractAdmissionMedicationChangesSet(factory, patientTTOs.getMedicationChanges());
    md.getAdmissionMedicationChanges().addAll(medChanges);
    try {
        factory.save(md);
    } catch(StaleObjectException soe)
    {
        throw new DomainRuntimeException(soe);
    }
}
项目:openmaxims-linux    文件:HL7TTOIFImpl.java   
/**
* Impl for  TTO HL7 messages you finds the current I/P care context for the patient in the message (Note there will always be one open(no end/discharge date) I/P care context), then the MedicationDetails record for the care context and  replace the TTO coll
*/
public void setPatientCareContextTTORecord(ims.clinical.vo.PatientTTOIfVo patientTTOs)
{
    if(patientTTOs==null)
        throw new DomainRuntimeException("Message details are null, cannot process message");
    if(patientTTOs.getPatient()==null)
        throw new DomainRuntimeException("Patient details are null, cannot process message");

    DomainFactory factory = getDomainFactory();
    CareContext careContext = getOpenInPatientCareContext(patientTTOs.getPatient());
    if (careContext==null)
        throw new DomainRuntimeException("Open inpatient care context cannot be found for patient");
    MedicationDetails md = getMedicationDetailsFromCareContext(careContext);
    if (md==null)
        throw new DomainRuntimeException("Failed to get or create Medication Details record");

    md.getTTAs().clear();
    md.getAdmissionMedicationChanges().clear();
    Set<?> ttoFromMessage=TTODetailsIFVoAssembler.extractTTAMedicationSet(factory,patientTTOs.getTTOs() );
    md.getTTAs().addAll(ttoFromMessage);

    Set<?> medChanges=AdmissionMedicationChangesVoAssembler.extractAdmissionMedicationChangesSet(factory, patientTTOs.getMedicationChanges());
    md.getAdmissionMedicationChanges().addAll(medChanges);
    try {
        factory.save(md);
    } catch(StaleObjectException soe)
    {
        throw new DomainRuntimeException(soe);
    }
}