Java 类ims.core.vo.domain.PatientShortAssembler 实例源码

项目:AvoinApotti    文件:BedInfoDialogImpl.java   
public PatientShortCollection getPatientsForCurrentBay(LocationRefVo currentBay)
{
    StringBuilder query = new StringBuilder();
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    query.append("SELECT patients FROM InpatientEpisode AS inpEp LEFT JOIN inpEp.pasEvent AS pasEv ");
    query.append("LEFT JOIN pasEv.patient AS patients ");
    query.append("LEFT JOIN inpEp.bed AS bed ");
    query.append("LEFT JOIN bed.bay AS patientBay ");

    query.append("WHERE patientBay.id = :bay ");
    paramNames.add("bay");
    paramValues.add(currentBay.getID_Location());

    return PatientShortAssembler.createPatientShortCollectionFromPatient(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:AvoinApotti    文件:ADTImpl.java   
public void cancelInpatientLeave(PatientShort patient) throws StaleObjectException
{
    DomainFactory factory = getDomainFactory();

    Patient domPatient = PatientShortAssembler.extractPatient(factory, patient);
    InpatientEpisode epis = getCurrentAdmission(factory, patient);
    if (epis != null)
    {
    PASEvent pasevent=epis.getPasEvent();
    Location loc=(Location)factory.getDomainObject(Location.class, domPatient.getWard().getId());
    pasevent.setLocation(loc);
    epis.setPasEvent(pasevent);

    epis.setIsOnLeave(Boolean.FALSE);
    factory.save(epis);
    }
}
项目:AvoinApotti    文件:PatientKioskOperationsImpl.java   
private PatientKioskPatientVo populatePatientKioskFromBookingAppointment(PatientRefVo patient) 
{
    if(patient == null || patient.getID_Patient() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    ims.core.patient.domain.objects.Patient doPatient = (Patient) factory.getDomainObject(Patient.class, patient.getID_Patient());
    PatientShort patientShort = PatientShortAssembler.create(doPatient);

    if(patientShort != null)
    {
        PatientKioskPatientVo newPatient = new PatientKioskPatientVo();
        newPatient.setID(patientShort.getID_Patient());
        newPatient.setSurname(patientShort.getNameIsNotNull() ? patientShort.getName().getSurname() : null);
        newPatient.setDOB(patientShort.getDob() != null ? patientShort.getDob().toDate() : null);
        newPatient.setDisplayName(patientShort.getNameIsNotNull() ? patientShort.getName().toString() : null);
        newPatient.setGender(patientShort.getSex());
        newPatient.setPostCode(patientShort.getAddress() != null ? removeString(patientShort.getAddress().getPostCode(), " ") : null);

        return newPatient;
    }

    return null;
}
项目:AvoinApotti    文件:DischargeSummaryConsultatntWardAndPacuImpl.java   
public PatientRefVo getPatientRef(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - referral is null or missing ID");

    String hql = "from Patient as pat where (pat.id in (select cr.patient.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    DomainFactory factory = getDomainFactory();

    return PatientShortAssembler.create((Patient) (factory.find(hql, paramNames, paramValues)).get(0));
}
项目:AvoinApotti    文件:DischargeSummaryWardPacuImpl.java   
public PatientRefVo getPatientRef(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - referral is null or missing ID");

    String hql = "from Patient as pat where (pat.id in (select cr.patient.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    DomainFactory factory = getDomainFactory();

    return PatientShortAssembler.create((Patient) (factory.find(hql, paramNames, paramValues)).get(0));
}
项目:openMAXIMS    文件:PullCaseNoteImpl.java   
public PatientShort getPatientForIdentifier(PatIdType identifierType, String identifierValue)
{
    if (identifierType == null || identifierValue == null)
        return null;

    StringBuilder query = new StringBuilder("SELECT patient FROM Patient AS patient LEFT JOIN patient.identifiers AS ident LEFT JOIN ident.type AS identType");
    query.append(" WHERE ident.value = :ID_VALUE AND identType.id = :ID_TYPE AND (patient.isRIE is null OR patient.isRIE = 0) ");

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("ID_VALUE");     paramValues.add(identifierValue);
    paramNames.add("ID_TYPE");      paramValues.add(identifierType.getID());

    return PatientShortAssembler.create((Patient) getDomainFactory().findFirst(query.toString(), paramNames, paramValues));
}
项目:openMAXIMS    文件:BedInfoDialogImpl.java   
public PatientShortCollection getPatientsForCurrentBay(LocationRefVo currentBay)
{
    StringBuilder query = new StringBuilder();
    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    query.append("SELECT patients FROM InpatientEpisode AS inpEp LEFT JOIN inpEp.pasEvent AS pasEv ");
    query.append("LEFT JOIN pasEv.patient AS patients ");
    query.append("LEFT JOIN inpEp.bed AS bed ");
    query.append("LEFT JOIN bed.bay AS patientBay ");

    query.append("WHERE patientBay.id = :bay ");
    paramNames.add("bay");
    paramValues.add(currentBay.getID_Location());

    return PatientShortAssembler.createPatientShortCollectionFromPatient(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:openMAXIMS    文件:ADTImpl.java   
public void cancelInpatientLeave(PatientShort patient) throws StaleObjectException
{
    DomainFactory factory = getDomainFactory();

    Patient domPatient = PatientShortAssembler.extractPatient(factory, patient);
    InpatientEpisode epis = getCurrentAdmission(factory, patient);
    if (epis != null)
    {
    PASEvent pasevent=epis.getPasEvent();
    Location loc=(Location)factory.getDomainObject(Location.class, domPatient.getWard().getId());
    pasevent.setLocation(loc);
    epis.setPasEvent(pasevent);

    epis.setIsOnLeave(Boolean.FALSE);
    factory.save(epis);
    }
}
项目:openMAXIMS    文件:PatientKioskOperationsImpl.java   
private PatientKioskPatientVo populatePatientKioskFromBookingAppointment(PatientRefVo patient) 
{
    if(patient == null || patient.getID_Patient() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    ims.core.patient.domain.objects.Patient doPatient = (Patient) factory.getDomainObject(Patient.class, patient.getID_Patient());
    PatientShort patientShort = PatientShortAssembler.create(doPatient);

    if(patientShort != null)
    {
        PatientKioskPatientVo newPatient = new PatientKioskPatientVo();
        newPatient.setID(patientShort.getID_Patient());
        newPatient.setSurname(patientShort.getNameIsNotNull() ? patientShort.getName().getSurname() : null);
        newPatient.setDOB(patientShort.getDob() != null ? patientShort.getDob().toDate() : null);
        newPatient.setDisplayName(patientShort.getNameIsNotNull() ? patientShort.getName().toString() : null);
        newPatient.setGender(patientShort.getSex());
        newPatient.setPostCode(patientShort.getAddress() != null ? removeString(patientShort.getAddress().getPostCode(), " ") : null);

        return newPatient;
    }

    return null;
}
项目:openMAXIMS    文件:PatientKioskOperationsImpl.java   
private PatientKioskPatientVo populatePatientKioskFromBookingAppointment(PatientRefVo patient) 
{
    if(patient == null || patient.getID_Patient() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    ims.core.patient.domain.objects.Patient doPatient = (Patient) factory.getDomainObject(Patient.class, patient.getID_Patient());
    PatientShort patientShort = PatientShortAssembler.create(doPatient);

    if(patientShort != null)
    {
        PatientKioskPatientVo newPatient = new PatientKioskPatientVo();
        newPatient.setID(patientShort.getID_Patient());
        newPatient.setSurname(patientShort.getNameIsNotNull() ? patientShort.getName().getSurname() : null);
        newPatient.setDOB(patientShort.getDob() != null ? patientShort.getDob().toDate() : null);
        newPatient.setDisplayName(patientShort.getNameIsNotNull() ? patientShort.getName().toString() : null);
        newPatient.setGender(patientShort.getSex());
        newPatient.setPostCode(patientShort.getAddress() != null ? removeString(patientShort.getAddress().getPostCode(), " ") : null);

        return newPatient;
    }

    return null;
}
项目:openMAXIMS    文件:DischargeSummaryConsultatntWardAndPacuImpl.java   
public PatientRefVo getPatientRef(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - referral is null or missing ID");

    String hql = "from Patient as pat where (pat.id in (select cr.patient.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    DomainFactory factory = getDomainFactory();

    return PatientShortAssembler.create((Patient) (factory.find(hql, paramNames, paramValues)).get(0));
}
项目:openMAXIMS    文件:DischargeSummaryWardPacuImpl.java   
public PatientRefVo getPatientRef(CatsReferralRefVo referral)
{
    if (referral == null || referral.getID_CatsReferral() == null)
        throw new CodingRuntimeException("Logical error - referral is null or missing ID");

    String hql = "from Patient as pat where (pat.id in (select cr.patient.id from CatsReferral as cr where cr.id = :refID))";

    ArrayList<String> paramNames = new ArrayList<String>();
    paramNames.add("refID");

    ArrayList<Object> paramValues = new ArrayList<Object>();
    paramValues.add(referral.getID_CatsReferral());

    DomainFactory factory = getDomainFactory();

    return PatientShortAssembler.create((Patient) (factory.find(hql, paramNames, paramValues)).get(0));
}
项目:openmaxims-linux    文件:ADTImpl.java   
public void cancelInpatientLeave(PatientShort patient) throws StaleObjectException
{
    DomainFactory factory = getDomainFactory();

    Patient domPatient = PatientShortAssembler.extractPatient(factory, patient);
    InpatientEpisode epis = getCurrentAdmission(factory, patient);
    if (epis != null)
    {
    PASEvent pasevent=epis.getPasEvent();
    Location loc=(Location)factory.getDomainObject(Location.class, domPatient.getWard().getId());
    pasevent.setLocation(loc);
    epis.setPasEvent(pasevent);

    epis.setIsOnLeave(Boolean.FALSE);
    factory.save(epis);
    }
}
项目:AvoinApotti    文件:CarePlanReviewImpl.java   
public PatientShort getPatientFromCareContext(CareContextRefVo voRef)
{
    String hqlQuery = " select cs.patient from CareSpell cs left join cs.episodes ep left join ep.careContexts cc where cc.id = " + voRef.getID_CareContext()+ " and cs.patient.isActive = true and cs.patient.dod is null";
    List list = getDomainFactory().find(hqlQuery);

    if(list != null && list.size() > 0)
    {
        return PatientShortAssembler.createPatientShortCollectionFromPatient(list).get(0); 
    }

    return null;
}
项目:AvoinApotti    文件:HospitalReportImpl.java   
public PatientShort getPatientFromCareContext(CareContextRefVo voRef)
{
    String hqlQuery = " select cs.patient from CareSpell cs left join cs.episodes ep left join ep.careContexts cc where cc.id = " + voRef.getID_CareContext();
    List list = getDomainFactory().find(hqlQuery);

    if(list != null && list.size() > 0)
    {
        return PatientShortAssembler.createPatientShortCollectionFromPatient(list).get(0);
    }

    return null;
}
项目:AvoinApotti    文件:TransportImpl.java   
public PatientShort getPatient(PatientRefVo patient)
{
    if (patient == null)
        return null;

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patient.getID_Patient()));
}
项目:AvoinApotti    文件:ADTAdmissionDetailsComponentImpl.java   
public PatientShort getPatient(PatientRefVo patientRef)
{
    if(patientRef == null || patientRef.getID_Patient()==null)
        throw new CodingRuntimeException("Cannot get Patient value on null patientRef.");

    DomainFactory factory = getDomainFactory();
    Patient domPatient=(Patient) factory.getDomainObject(Patient.class, patientRef.getID_Patient());
    return PatientShortAssembler.create(domPatient);
}
项目:AvoinApotti    文件:PendingElectiveAdmissionsListELComponentImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRef)
{
    if(patientRef == null)
        throw new CodingRuntimeException("Cannot get Patient on null patientRef.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRef.getID_Patient()));
}
项目:AvoinApotti    文件:DocumentWorklistImpl.java   
public PatientShort getPatientShort(PatientRefVo patRef)
{
    if (!patRef.getID_PatientIsNotNull())
    {
        throw new DomainRuntimeException("Patient is invalid" );
    }
    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class,patRef.getID_Patient()));

}
项目:AvoinApotti    文件:NotificationsImpl.java   
public PatientShort getPatientById(Integer patientId) 
{
    DomainFactory factory = getDomainFactory();
    Patient doPatient = (Patient)factory.getDomainObject(Patient.class, patientId);

    if(doPatient == null)
        throw new DomainRuntimeException("Patient not found");

    PatientShort patient = PatientShortAssembler.create(doPatient);
    patient.setHasAlerts(hasPatientAlerts(patientId));
    patient.setHasAllergies(hasPatientAllergies(patientId));
    patient.calculateAge();

    return patient;
}
项目:AvoinApotti    文件:CorrespondenceListImpl.java   
public ims.core.vo.PatientShort getPatientForCareContextId(CareContextRefVo careContextRefVo) 
{
    List<?> list = getDomainFactory().find("select cc.episodeOfCare.careSpell.patient from CareContext as cc where cc.id = :ID", 
            new String[] {"ID"}, new Object[] {careContextRefVo.getID_CareContext()}, 1);

    if(list == null || list.size() == 0)
        return null;

    return PatientShortAssembler.create((Patient) list.get(0));
}
项目:AvoinApotti    文件:ADTDischargeDetailsComponentImpl.java   
public PatientShort getPatientShort(PatientRefVo patRef)
{
    if( patRef == null)
        throw new CodingRuntimeException("This PatientRefVo is null");

    DomainFactory factory = getDomainFactory();
    Patient doPatient = (Patient) factory.getDomainObject(Patient.class, patRef.getID_Patient());

    return PatientShortAssembler.create(doPatient);
}
项目:AvoinApotti    文件:BedAdmissionComponentImpl.java   
public PatientShort getPatientShort(PatientRefVo patient)
{
    if (patient == null || patient.getID_Patient() == null)
        return null;

    return PatientShortAssembler.create((ims.core.patient.domain.objects.Patient) getDomainFactory().getDomainObject(ims.core.patient.domain.objects.Patient.class, patient.getID_Patient()));
}
项目:AvoinApotti    文件:ADTPatientAdmissionImpl.java   
public PatientShort getPatient(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
        throw new CodingRuntimeException("Cannot get Patient value on null patientRef.");

    DomainFactory factory = getDomainFactory();
    Patient domPat = (Patient) factory.getDomainObject(Patient.class, patientRef.getID_Patient());
    return PatientShortAssembler.create(domPat);
}
项目:AvoinApotti    文件:InpatientListImpl.java   
public PatientShort getPatient(PatientRefVo patRefVo) throws DomainInterfaceException
{
    if (patRefVo == null)
        throw new CodingRuntimeException("Can not search on patRefVo value");

    DomainFactory factory = getDomainFactory();
    return PatientShortAssembler.create((Patient) factory.getDomainObject(Patient.class, patRefVo.getID_Patient()));
}
项目:AvoinApotti    文件:DynamicAssessmentsImpl.java   
public PatientShort getPatient(PatientRefVo patient)
{
    if(patient == null || !patient.getID_PatientIsNotNull())
        throw new CodingRuntimeException("Can not Patient on null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patient.getID_Patient()));
}
项目:AvoinApotti    文件:PendingArrivalsImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
    {
        throw new CodingRuntimeException("Cannot get PatientShort on null Id ");
    }

    DomainFactory factory = getDomainFactory();
    Patient domainPatient = (Patient) factory.getDomainObject(Patient.class, patientRef.getID_Patient());

    return PatientShortAssembler.create(domainPatient);
}
项目:AvoinApotti    文件:EDAssessmentComponentImpl.java   
public ims.core.vo.PatientShort getPatientShort(ims.core.patient.vo.PatientRefVo patientRefVo)
{
    if(patientRefVo == null || patientRefVo.getID_Patient() == null)
        throw new CodingRuntimeException("Cannnot get EOC for a null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRefVo.getID_Patient()));
}
项目:AvoinApotti    文件:TriageImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRefVo)
{
    if(patientRefVo == null || patientRefVo.getID_Patient() == null)
        throw new CodingRuntimeException("Cannnot get EOC for a null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRefVo.getID_Patient()));
}
项目:AvoinApotti    文件:ClinicianAssessmentWorklistImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRefVo)
{
    if(patientRefVo == null || patientRefVo.getID_Patient() == null)
        throw new CodingRuntimeException("Cannnot get EOC for a null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRefVo.getID_Patient()));
}
项目:AvoinApotti    文件:EDDecisionToAdmitDialogImpl.java   
public ims.core.vo.PatientShort getPatientShort(ims.core.patient.vo.PatientRefVo patRef)
{
    if( patRef == null || patRef.getID_Patient() == null)
        throw new CodingRuntimeException("Cannot get Patient record for a null Patient Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patRef.getID_Patient()));

}
项目:AvoinApotti    文件:TrackingAndAttendanceWorklistsImpl.java   
public PatientShort getPatient(PatientRefVo patientRef)
{
    if(patientRef == null || patientRef.getID_Patient() == null)
        return null;

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRef.getID_Patient()));
}
项目:AvoinApotti    文件:EDWorklistToAssessmentFormImpl.java   
public PatientShort getPatientShort(PatientRefVo record) 
{
    if(record == null || record.getID_Patient() == null)
        throw new CodingRuntimeException("Cannnot get Patient for a null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, record.getID_Patient()));

}
项目:AvoinApotti    文件:AttendanceListImpl.java   
public PatientShort getPatient(EmergencyAttendanceRefVo emergencyAttendanceRef)
{
    String hql = "select c2_1.patient\r\n" + 
            "from EmergencyAttendance as e1_1 left join e1_1.careContext as c1_1 left join c1_1.episodeOfCare as e2_1 left join e2_1.careSpell as c2_1 where e1_1.id = :ID";

    DomainFactory domainFactory = getDomainFactory();

    List list = domainFactory.find(hql, new String[] {"ID"}, new Object[] {emergencyAttendanceRef.getID_EmergencyAttendance()});

    if(list != null && list.size() > 0)
        return PatientShortAssembler.create((Patient) list.get(0));

    return null;
}
项目:AvoinApotti    文件:EDWhiteBoardDialogImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
    {
        throw new CodingRuntimeException("Cannot get Patient by null Id ");
    }

    DomainFactory factory = getDomainFactory();

    Patient domainPatient = (Patient) factory.getDomainObject(Patient.class, patientRef.getID_Patient());

    return PatientShortAssembler.create(domainPatient);
}
项目:AvoinApotti    文件:SessionManagementImpl.java   
public PatientShort getPatientShort(PatientRefVo patientRef)
{
    if(patientRef == null || patientRef.getID_Patient() == null)
        throw new CodingRuntimeException("Cannot get Patient on null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientRef.getID_Patient()));
}
项目:AvoinApotti    文件:CcoContextSetter.java   
public void setPatient(int patId)
{
    DomainFactory factory = this.getDomainFactory();        
    Patient domPat = (Patient)factory.getDomainObject(Patient.class, patId);
    PatientShort patientVo = PatientShortAssembler.create(domPat);      
    CcoContextReader.setPatientShort(patientVo, ctx);       
}
项目:AvoinApotti    文件:ContextSetter.java   
public void setPatient(int patId)
{
    DomainFactory factory = this.getDomainFactory();        
    Patient domPat = (Patient)factory.getDomainObject(Patient.class, patId);
    PatientShort patientVo = PatientShortAssembler.create(domPat);      
    ContextReader.setPatientShort(patientVo, ctx);      
}
项目:AvoinApotti    文件:NHSParamProvider.java   
private PatientShort getPatientByNHS(String patientNHSNo) 
{
    if(patientNHSNo == null)
        return null;

    LookupInstVo lookInstNHS = new LookupInstVo(NHS_NumberInstId);

    DomainFactory factory = getDomainFactory();

    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String query = "from Patient p left join p.identifiers as ids where ids.type = :idtype and ids.value = :nhs";

    markers.add("idtype");
    values.add(getDomLookup(lookInstNHS));
    markers.add("nhs");
    values.add(patientNHSNo);

    List<Object> patients=factory.find(query,markers,values);

    if (patients!=null && patients.size()>0)
    {
        return PatientShortAssembler.create((Patient) patients.get(0));
    }

    return null;
}
项目:AvoinApotti    文件:MoveToWardSpecimenCollectionImpl.java   
public PatientShort getPatient(Integer patientId)
{
    if (patientId == null)
        throw new CodingRuntimeException("Cannot get Patient on null Id.");

    return PatientShortAssembler.create((Patient) getDomainFactory().getDomainObject(Patient.class, patientId));
}