Java 类ims.core.vo.MedicWithMappingsLiteVo 实例源码

项目:AvoinApotti    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByExternalCode(TaxonomyType taxType, String codeVal)
{
    if (taxType == null || codeVal == null) 
        throw new DomainRuntimeException("External Code and type not supplied for Medic");

    List hcpList = getDomHcpByExternalCode(taxType, codeVal);
    if (hcpList != null && hcpList.size() > 0)
    {
        Hcp hcp = (Hcp)hcpList.get(0);
        if (hcp instanceof Medic)
        {
            return MedicWithMappingsLiteVoAssembler.create((Medic)hcp);
        }
    }
    return null;
}
项目:openMAXIMS    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByExternalCode(TaxonomyType taxType, String codeVal)
{
    if (taxType == null || codeVal == null) 
        throw new DomainRuntimeException("External Code and type not supplied for Medic");

    List hcpList = getDomHcpByExternalCode(taxType, codeVal);
    if (hcpList != null && hcpList.size() > 0)
    {
        Hcp hcp = (Hcp)hcpList.get(0);
        if (hcp instanceof Medic)
        {
            return MedicWithMappingsLiteVoAssembler.create((Medic)hcp);
        }
    }
    return null;
}
项目:openMAXIMS    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByExternalCode(TaxonomyType taxType, String codeVal)
{
    if (taxType == null || codeVal == null) 
        throw new DomainRuntimeException("External Code and type not supplied for Medic");

    List hcpList = getDomHcpByExternalCode(taxType, codeVal);
    if (hcpList != null && hcpList.size() > 0)
    {
        Hcp hcp = (Hcp)hcpList.get(0);
        if (hcp instanceof Medic)
        {
            return MedicWithMappingsLiteVoAssembler.create((Medic)hcp);
        }
    }
    return null;
}
项目:openmaxims-linux    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByExternalCode(TaxonomyType taxType, String codeVal)
{
    if (taxType == null || codeVal == null) 
        throw new DomainRuntimeException("External Code and type not supplied for Medic");

    List hcpList = getDomHcpByExternalCode(taxType, codeVal);
    if (hcpList != null && hcpList.size() > 0)
    {
        Hcp hcp = (Hcp)hcpList.get(0);
        if (hcp instanceof Medic)
        {
            return MedicWithMappingsLiteVoAssembler.create((Medic)hcp);
        }
    }
    return null;
}
项目:AvoinApotti    文件:PatientListsImpl.java   
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);

    voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
    voPasContact.setLocation(voLoc);

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);

    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);


    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);         

    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoOutpatient.Contactno);
    try {
        voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
    } catch (ParseException e) {
        voPasContact.setAppointmentDateTime(null);
    }

    PatientShort voPatientShort = new PatientShort();
    voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);    

    voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);                     
    voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);                       

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));  
    else
        voPatientShort.setDob(null);

    if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.calculateAge();

    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
    voPasContact.setPatient(voPatientShort);            
    voPasContact.setGPCode(dtoOutpatient.Gpcode);

    if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }       
}
项目:AvoinApotti    文件:Logic.java   
private void prePopulateTemplateTab() 
{
    form.lyrLetterCreate().tabTemplate().imbSearchTemplate().setAsDefaultButton();//    WDEV-13750

    for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++)
    {
        OutPatientListVo outpatient = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue();

        if(outpatient == null)
            continue;

        if(outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getConsultantIsNotNull() && outpatient.getPasEvent().getSpecialtyIsNotNull())
        {
            MedicWithMappingsLiteVo medic = outpatient.getPasEvent().getConsultant();
            HcpLiteVo hcp = new HcpLiteVo(medic.getID_Hcp(), medic.getBoVersion());
            hcp.setMos(medic.getMos());

            if(form.lyrLetterCreate().tabTemplate().ccResponsible().getValue() == null)
                form.lyrLetterCreate().tabTemplate().ccResponsible().setValue(hcp);

            if(form.lyrLetterCreate().tabTemplate().cmbSpecialty().getValue() == null)
                form.lyrLetterCreate().tabTemplate().cmbSpecialty().setValue(outpatient.getPasEvent().getSpecialty());

            break;
        }
    }

    form.lyrLetterCreate().tabTemplate().dteDocDate().setValue(form.lyrLetterCreate().tabClinicList().dteClinicDate().getValue());
    //wdev-14320
    if( ConfigFlag.DOM.CLINIC_LETTER_BATCH_CREATE_SUMMARY_NOTE_MODE.getValue().equals("Select"))
        populateSummaryNoteDynamicGrid();
}
项目:AvoinApotti    文件:InpatientListImpl.java   
private MedicWithMappingsLiteVo getMedicWithMappingsLiteVo(HcpRefVo consultant) {
    DomainFactory factory = getDomainFactory();
    if(consultant != null && consultant.getID_HcpIsNotNull()){
        DomainObject medic = factory.getDomainObject(Medic.class, consultant.getID_Hcp());
        if(medic!=null)
            return MedicWithMappingsLiteVoAssembler.create((Medic)medic);
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void prePopulateTemplateTab() 
{
    form.lyrLetterCreate().tabTemplate().imbSearchTemplate().setAsDefaultButton();//    WDEV-13750

    for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++)
    {
        OutPatientListVo outpatient = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue();

        if(outpatient == null)
            continue;

        if(outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getConsultantIsNotNull() && outpatient.getPasEvent().getSpecialtyIsNotNull())
        {
            MedicWithMappingsLiteVo medic = outpatient.getPasEvent().getConsultant();
            HcpLiteVo hcp = new HcpLiteVo(medic.getID_Hcp(), medic.getBoVersion());
            hcp.setMos(medic.getMos());

            if(form.lyrLetterCreate().tabTemplate().ccResponsible().getValue() == null)
                form.lyrLetterCreate().tabTemplate().ccResponsible().setValue(hcp);

            if(form.lyrLetterCreate().tabTemplate().cmbSpecialty().getValue() == null)
                form.lyrLetterCreate().tabTemplate().cmbSpecialty().setValue(outpatient.getPasEvent().getSpecialty());

            break;
        }
    }

    form.lyrLetterCreate().tabTemplate().dteDocDate().setValue(form.lyrLetterCreate().tabClinicList().dteClinicDate().getValue());
    //wdev-14320
    if( ConfigFlag.DOM.CLINIC_LETTER_BATCH_CREATE_SUMMARY_NOTE_MODE.getValue().equals("Select"))
        populateSummaryNoteDynamicGrid();
}
项目:openMAXIMS    文件:InpatientEpisodeMaintenanceImpl.java   
public MedicWithMappingsLiteVo getMedicWithMappingsLiteVoFromIMos(IMos iMos)
{
    if(iMos == null)
        return null;
    DomainFactory factory = getDomainFactory();
    MemberOfStaff mos =(MemberOfStaff)factory.getDomainObject(MemberOfStaff.class, iMos.getIMosId());
    Hcp hcp = mos.getHcp();
    Medic medic = (Medic)factory.getDomainObject(Medic.class, hcp.getId());
    return MedicWithMappingsLiteVoAssembler.create(medic);
}
项目:openMAXIMS    文件:InpatientListImpl.java   
private MedicWithMappingsLiteVo getMedicWithMappingsLiteVo(HcpRefVo consultant) {
    DomainFactory factory = getDomainFactory();
    if(consultant != null && consultant.getID_HcpIsNotNull()){
        DomainObject medic = factory.getDomainObject(Medic.class, consultant.getID_Hcp());
        if(medic!=null)
            return MedicWithMappingsLiteVoAssembler.create((Medic)medic);
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void prePopulateTemplateTab() 
{
    form.lyrLetterCreate().tabTemplate().imbSearchTemplate().setAsDefaultButton();//    WDEV-13750

    for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++)
    {
        OutPatientListVo outpatient = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue();

        if(outpatient == null)
            continue;

        if(outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getConsultantIsNotNull() && outpatient.getPasEvent().getSpecialtyIsNotNull())
        {
            MedicWithMappingsLiteVo medic = outpatient.getPasEvent().getConsultant();
            HcpLiteVo hcp = new HcpLiteVo(medic.getID_Hcp(), medic.getBoVersion());
            hcp.setMos(medic.getMos());

            if(form.lyrLetterCreate().tabTemplate().ccResponsible().getValue() == null)
                form.lyrLetterCreate().tabTemplate().ccResponsible().setValue(hcp);

            if(form.lyrLetterCreate().tabTemplate().cmbSpecialty().getValue() == null)
                form.lyrLetterCreate().tabTemplate().cmbSpecialty().setValue(outpatient.getPasEvent().getSpecialty());

            break;
        }
    }

    form.lyrLetterCreate().tabTemplate().dteDocDate().setValue(form.lyrLetterCreate().tabClinicList().dteClinicDate().getValue());
    //wdev-14320
    if( ConfigFlag.DOM.CLINIC_LETTER_BATCH_CREATE_SUMMARY_NOTE_MODE.getValue().equals("Select"))
        populateSummaryNoteDynamicGrid();
}
项目:openMAXIMS    文件:InpatientListImpl.java   
private MedicWithMappingsLiteVo getMedicWithMappingsLiteVo(HcpRefVo consultant) {
    DomainFactory factory = getDomainFactory();
    if(consultant != null && consultant.getID_HcpIsNotNull()){
        DomainObject medic = factory.getDomainObject(Medic.class, consultant.getID_Hcp());
        if(medic!=null)
            return MedicWithMappingsLiteVoAssembler.create((Medic)medic);
    }

    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void prePopulateTemplateTab() 
{
    form.lyrLetterCreate().tabTemplate().imbSearchTemplate().setAsDefaultButton();//    WDEV-13750

    for(int i=0; i<form.lyrLetterCreate().tabClinicList().grdPatient().getRows().size(); i++)
    {
        OutPatientListVo outpatient = form.lyrLetterCreate().tabClinicList().grdPatient().getRows().get(i).getValue();

        if(outpatient == null)
            continue;

        if(outpatient.getPasEventIsNotNull() && outpatient.getPasEvent().getConsultantIsNotNull() && outpatient.getPasEvent().getSpecialtyIsNotNull())
        {
            MedicWithMappingsLiteVo medic = outpatient.getPasEvent().getConsultant();
            HcpLiteVo hcp = new HcpLiteVo(medic.getID_Hcp(), medic.getBoVersion());
            hcp.setMos(medic.getMos());

            if(form.lyrLetterCreate().tabTemplate().ccResponsible().getValue() == null)
                form.lyrLetterCreate().tabTemplate().ccResponsible().setValue(hcp);

            if(form.lyrLetterCreate().tabTemplate().cmbSpecialty().getValue() == null)
                form.lyrLetterCreate().tabTemplate().cmbSpecialty().setValue(outpatient.getPasEvent().getSpecialty());

            break;
        }
    }

    form.lyrLetterCreate().tabTemplate().dteDocDate().setValue(form.lyrLetterCreate().tabClinicList().dteClinicDate().getValue());
    //wdev-14320
    if( ConfigFlag.DOM.CLINIC_LETTER_BATCH_CREATE_SUMMARY_NOTE_MODE.getValue().equals("Select"))
        populateSummaryNoteDynamicGrid();
}
项目:openmaxims-linux    文件:InpatientListImpl.java   
private MedicWithMappingsLiteVo getMedicWithMappingsLiteVo(HcpRefVo consultant) {
    DomainFactory factory = getDomainFactory();
    if(consultant != null && consultant.getID_HcpIsNotNull()){
        DomainObject medic = factory.getDomainObject(Medic.class, consultant.getID_Hcp());
        if(medic!=null)
            return MedicWithMappingsLiteVoAssembler.create((Medic)medic);
    }

    return null;
}
项目:AvoinApotti    文件:PatientListsImpl.java   
private void populatePasContactFromDtoInpatient(PasContactVo voPasContact, InpatientlistRecord dtoInpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class); 
    voLoc = locImpl.getLocationByLocalCode(dtoInpatient.Rescode,LocationType.WARD);
    voPasContact.setLocation(voLoc);

    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoInpatient.Specialty);                  
    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoInpatient.Contactno);      
    try 
    {
        //Discharge Date
        voPasContact.setDischargeDateTime(dtoInpatient.Dischargedate == "" || dtoInpatient.Dischargedate == null ? null : new DateTime (dtoInpatient.Dischargedate));
    } 
    catch (ParseException e) 
    {
        voPasContact.setDischargeDateTime(null);
        e.printStackTrace();
    }

    PatientShort voPatientShort = new PatientShort();

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoInpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);

    voPatientShort.setName(dtoInpatient.Snm, dtoInpatient.Fnm1, null);  

    voPatientShort.addId(PatIdType.HOSPNUM, dtoInpatient.Hospnum);                      
    voPatientShort.addId(PatIdType.CHARTNUM, dtoInpatient.Chartnum);                        

    voPatientShort.setDob(dtoInpatient.Dob == "" ? null : new PartialDate(dtoInpatient.Dob));   

    if(dtoInpatient.Dod != null && dtoInpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoInpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    voPatientShort.calculateAge();
    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoInpatient.Sex));
    voPasContact.setPatient(voPatientShort);            

    voPasContact.setGPCode(dtoInpatient.Gpcode); 

    if (dtoInpatient.Documentstatus != ""  && Integer.valueOf(dtoInpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoInpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }
}
项目:AvoinApotti    文件:ADTImpl.java   
/**
*   Populates as many of the PasEvent fields as it can from the PasContact
*  CareContext,IsVip,ReferringGP,SourceOfReferral are left as null 
*  EventDateTime depends on whether we are listing inpatients or outpatients and
*  is populated external to this method.
*/
public PasEventVo createPasEvent(DateTime eventDateTime, PatientRefVo voRefPatient, PasContactVo voPasContact) throws StaleObjectException, UniqueKeyViolationException   
{
    PasEventVo voPasEvent = new PasEventVo();

    voPasEvent.setEventDateTime(eventDateTime);

    if (voPasContact.getConsultant() != null)
    {
        MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo(voPasContact.getConsultant().getID_Hcp(), voPasContact.getConsultant().getVersion_Hcp());
        medLite.setMos(voPasContact.getConsultant().getMos());
        voPasEvent.setConsultant(medLite);          
    }
    voPasEvent.setLocation(voPasContact.getLocation());
    voPasEvent.setSpecialty(voPasContact.getSpecialty());
    voPasEvent.setPasEventId(voPasContact.getContactNumber());
    //      voPasEvent.setPatient(voPasContact.getPatient());
    GpLiteToPracticeLiteVo voGpLiteToPracList = synchronizeGPPracticeDetails(voPasContact.getGPCode());
    if (voGpLiteToPracList != null)
    {
        voPasEvent.setReferringGP(voGpLiteToPracList.getGp());
        if (voGpLiteToPracList.getPracticeIsNotNull() && voGpLiteToPracList.getPractice().getSurgeriesIsNotNull() && voGpLiteToPracList.getPractice().getSurgeries().size() > 0)
            voPasEvent.setReferringGpSurgery(voGpLiteToPracList.getPractice().getSurgeries().get(0));
    }

    if (voPasContact.getAppointmentDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.OUTPATIENT);
    else if (voPasContact.getDischargeDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.INPATIENT);

    DomainFactory factory = getDomainFactory();
    PASEvent domPasEvent = PasEventVoAssembler.extractPASEvent(factory, voPasEvent);

    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, voRefPatient.getID_Patient().intValue()); 
    domPasEvent.setPatient(domPatient);
    try 
    {
        factory.save(domPasEvent);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException(e.getMessage());
    }

    return PasEventVoAssembler.create(domPasEvent);
}
项目:AvoinApotti    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByPasCode(String pasCode)
{
    return getMedicMedicMappingsByExternalCode(TaxonomyType.PAS, pasCode);
}
项目:openMAXIMS    文件:PatientListsImpl.java   
private void populatePasContactFromDtoInpatient(PasContactVo voPasContact, InpatientlistRecord dtoInpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class); 
    voLoc = locImpl.getLocationByLocalCode(dtoInpatient.Rescode,LocationType.WARD);
    voPasContact.setLocation(voLoc);

    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoInpatient.Specialty);                  
    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoInpatient.Contactno);      
    try 
    {
        //Discharge Date
        voPasContact.setDischargeDateTime(dtoInpatient.Dischargedate == "" || dtoInpatient.Dischargedate == null ? null : new DateTime (dtoInpatient.Dischargedate));
    } 
    catch (ParseException e) 
    {
        voPasContact.setDischargeDateTime(null);
        e.printStackTrace();
    }

    PatientShort voPatientShort = new PatientShort();

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoInpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);

    voPatientShort.setName(dtoInpatient.Snm, dtoInpatient.Fnm1, null);  

    voPatientShort.addId(PatIdType.HOSPNUM, dtoInpatient.Hospnum);                      
    voPatientShort.addId(PatIdType.CHARTNUM, dtoInpatient.Chartnum);                        

    voPatientShort.setDob(dtoInpatient.Dob == "" ? null : new PartialDate(dtoInpatient.Dob));   

    if(dtoInpatient.Dod != null && dtoInpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoInpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    voPatientShort.calculateAge();
    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoInpatient.Sex));
    voPasContact.setPatient(voPatientShort);            

    voPasContact.setGPCode(dtoInpatient.Gpcode); 

    if (dtoInpatient.Documentstatus != ""  && Integer.valueOf(dtoInpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoInpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }
}
项目:openMAXIMS    文件:PatientListsImpl.java   
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);

    voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
    voPasContact.setLocation(voLoc);

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);

    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);


    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);         

    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoOutpatient.Contactno);
    try {
        voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
    } catch (ParseException e) {
        voPasContact.setAppointmentDateTime(null);
    }

    PatientShort voPatientShort = new PatientShort();
    voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);    

    voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);                     
    voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);                       

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));  
    else
        voPatientShort.setDob(null);

    if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.calculateAge();

    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
    voPasContact.setPatient(voPatientShort);            
    voPasContact.setGPCode(dtoOutpatient.Gpcode);

    if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }       
}
项目:openMAXIMS    文件:ADTImpl.java   
/**
*   Populates as many of the PasEvent fields as it can from the PasContact
*  CareContext,IsVip,ReferringGP,SourceOfReferral are left as null 
*  EventDateTime depends on whether we are listing inpatients or outpatients and
*  is populated external to this method.
*/
public PasEventVo createPasEvent(DateTime eventDateTime, PatientRefVo voRefPatient, PasContactVo voPasContact) throws StaleObjectException, UniqueKeyViolationException   
{
    PasEventVo voPasEvent = new PasEventVo();

    voPasEvent.setEventDateTime(eventDateTime);

    if (voPasContact.getConsultant() != null)
    {
        MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo(voPasContact.getConsultant().getID_Hcp(), voPasContact.getConsultant().getVersion_Hcp());
        medLite.setMos(voPasContact.getConsultant().getMos());
        voPasEvent.setConsultant(medLite);          
    }
    voPasEvent.setLocation(voPasContact.getLocation());
    voPasEvent.setSpecialty(voPasContact.getSpecialty());
    voPasEvent.setPasEventId(voPasContact.getContactNumber());
    //      voPasEvent.setPatient(voPasContact.getPatient());
    GpLiteToPracticeLiteVo voGpLiteToPracList = synchronizeGPPracticeDetails(voPasContact.getGPCode());
    if (voGpLiteToPracList != null)
    {
        voPasEvent.setReferringGP(voGpLiteToPracList.getGp());
        if (voGpLiteToPracList.getPracticeIsNotNull() && voGpLiteToPracList.getPractice().getSurgeriesIsNotNull() && voGpLiteToPracList.getPractice().getSurgeries().size() > 0)
            voPasEvent.setReferringGpSurgery(voGpLiteToPracList.getPractice().getSurgeries().get(0));
    }

    if (voPasContact.getAppointmentDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.OUTPATIENT);
    else if (voPasContact.getDischargeDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.INPATIENT);

    DomainFactory factory = getDomainFactory();
    PASEvent domPasEvent = PasEventVoAssembler.extractPASEvent(factory, voPasEvent);

    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, voRefPatient.getID_Patient().intValue()); 
    domPasEvent.setPatient(domPatient);
    try 
    {
        factory.save(domPasEvent);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException(e.getMessage());
    }

    return PasEventVoAssembler.create(domPasEvent);
}
项目:openMAXIMS    文件:VoMapper.java   
protected final void renderMedicWithMappingsLiteVoToXCN(MedicWithMappingsLiteVo medic, XCN xcn, ProviderSystemVo providerSystem) throws DataTypeException
{
    LOG.debug("VoMapper renderMedicWithMappingsLiteVoToXCN: entry");

    if (medic != null)
    {
        //WDEV-2100
        TaxonomyMap natConsCodeMapping = medic.getMos().getExternalCode(TaxonomyType.NAT_CONS_CODE);

        // XCN.1 ID number (ST)
        if (natConsCodeMapping != null
                && natConsCodeMapping.getTaxonomyCode() != null)
        {
            xcn.getIDNumber().setValue(natConsCodeMapping.getTaxonomyCode());
        }

        //XCN.2 Family Name (FN)
        if (medic.getMos().getNameIsNotNull() 
                && medic.getName().getSurnameIsNotNull() 
                && medic.getName().getSurname().length() > 0)
        {
            xcn.getFamilyName().getSurname().setValue(medic.getName().getSurname());
        }

        //XCN.3 Given name (ST)
        if (medic.getName().getSurnameIsNotNull() 
                && medic.getName().getForenameIsNotNull() 
                && medic.getName().getForename().length() > 0)
        {
            xcn.getGivenName().setValue(medic.getName().getForename());
        }

        //XCN.5 Prefix (ST)
        if (medic.getMos().getNameIsNotNull() 
                && medic.getName().getTitleIsNotNull() 
                && medic.getName().getTitle().getID() > 0)
        {
            xcn.getPrefixEgDR().setValue(svc.getRemoteLookup(medic.getName().getTitle().getID(), providerSystem.getCodeSystem().getText()));
        }

    }

    LOG.debug("VoMapper renderMedicWithMappingsLiteVoToXCN: exit");
}
项目:openMAXIMS    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByPasCode(String pasCode)
{
    return getMedicMedicMappingsByExternalCode(TaxonomyType.PAS, pasCode);
}
项目:openMAXIMS    文件:PatientListsImpl.java   
private void populatePasContactFromDtoInpatient(PasContactVo voPasContact, InpatientlistRecord dtoInpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class); 
    voLoc = locImpl.getLocationByLocalCode(dtoInpatient.Rescode,LocationType.WARD);
    voPasContact.setLocation(voLoc);

    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoInpatient.Specialty);                  
    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoInpatient.Contactno);      
    try 
    {
        //Discharge Date
        voPasContact.setDischargeDateTime(dtoInpatient.Dischargedate == "" || dtoInpatient.Dischargedate == null ? null : new DateTime (dtoInpatient.Dischargedate));
    } 
    catch (ParseException e) 
    {
        voPasContact.setDischargeDateTime(null);
        e.printStackTrace();
    }

    PatientShort voPatientShort = new PatientShort();

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoInpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);

    voPatientShort.setName(dtoInpatient.Snm, dtoInpatient.Fnm1, null);  

    voPatientShort.addId(PatIdType.HOSPNUM, dtoInpatient.Hospnum);                      
    voPatientShort.addId(PatIdType.CHARTNUM, dtoInpatient.Chartnum);                        

    voPatientShort.setDob(dtoInpatient.Dob == "" ? null : new PartialDate(dtoInpatient.Dob));   

    if(dtoInpatient.Dod != null && dtoInpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoInpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    voPatientShort.calculateAge();
    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoInpatient.Sex));
    voPasContact.setPatient(voPatientShort);            

    voPasContact.setGPCode(dtoInpatient.Gpcode); 

    if (dtoInpatient.Documentstatus != ""  && Integer.valueOf(dtoInpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoInpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }
}
项目:openMAXIMS    文件:PatientListsImpl.java   
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);

    voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
    voPasContact.setLocation(voLoc);

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);

    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);


    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);         

    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoOutpatient.Contactno);
    try {
        voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
    } catch (ParseException e) {
        voPasContact.setAppointmentDateTime(null);
    }

    PatientShort voPatientShort = new PatientShort();
    voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);    

    voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);                     
    voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);                       

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));  
    else
        voPatientShort.setDob(null);

    if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.calculateAge();

    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
    voPasContact.setPatient(voPatientShort);            
    voPasContact.setGPCode(dtoOutpatient.Gpcode);

    if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }       
}
项目:openMAXIMS    文件:ADTImpl.java   
/**
*   Populates as many of the PasEvent fields as it can from the PasContact
*  CareContext,IsVip,ReferringGP,SourceOfReferral are left as null 
*  EventDateTime depends on whether we are listing inpatients or outpatients and
*  is populated external to this method.
*/
public PasEventVo createPasEvent(DateTime eventDateTime, PatientRefVo voRefPatient, PasContactVo voPasContact) throws StaleObjectException, UniqueKeyViolationException   
{
    PasEventVo voPasEvent = new PasEventVo();

    voPasEvent.setEventDateTime(eventDateTime);

    if (voPasContact.getConsultant() != null)
    {
        MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo(voPasContact.getConsultant().getID_Hcp(), voPasContact.getConsultant().getVersion_Hcp());
        medLite.setMos(voPasContact.getConsultant().getMos());
        voPasEvent.setConsultant(medLite);          
    }
    voPasEvent.setLocation(voPasContact.getLocation());
    voPasEvent.setSpecialty(voPasContact.getSpecialty());
    voPasEvent.setPasEventId(voPasContact.getContactNumber());
    //      voPasEvent.setPatient(voPasContact.getPatient());
    GpLiteToPracticeLiteVo voGpLiteToPracList = synchronizeGPPracticeDetails(voPasContact.getGPCode());
    if (voGpLiteToPracList != null)
    {
        voPasEvent.setReferringGP(voGpLiteToPracList.getGp());
        if (voGpLiteToPracList.getPracticeIsNotNull() && voGpLiteToPracList.getPractice().getSurgeriesIsNotNull() && voGpLiteToPracList.getPractice().getSurgeries().size() > 0)
            voPasEvent.setReferringGpSurgery(voGpLiteToPracList.getPractice().getSurgeries().get(0));
    }

    if (voPasContact.getAppointmentDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.OUTPATIENT);
    else if (voPasContact.getDischargeDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.INPATIENT);

    DomainFactory factory = getDomainFactory();
    PASEvent domPasEvent = PasEventVoAssembler.extractPASEvent(factory, voPasEvent);

    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, voRefPatient.getID_Patient().intValue()); 
    domPasEvent.setPatient(domPatient);
    try 
    {
        factory.save(domPasEvent);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException(e.getMessage());
    }

    return PasEventVoAssembler.create(domPasEvent);
}
项目:openMAXIMS    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByPasCode(String pasCode)
{
    return getMedicMedicMappingsByExternalCode(TaxonomyType.PAS, pasCode);
}
项目:openmaxims-linux    文件:PatientListsImpl.java   
private void populatePasContactFromDtoInpatient(PasContactVo voPasContact, InpatientlistRecord dtoInpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class); 
    voLoc = locImpl.getLocationByLocalCode(dtoInpatient.Rescode,LocationType.WARD);
    voPasContact.setLocation(voLoc);

    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoInpatient.Specialty);                  
    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoInpatient.Contactno);      
    try 
    {
        //Discharge Date
        voPasContact.setDischargeDateTime(dtoInpatient.Dischargedate == "" || dtoInpatient.Dischargedate == null ? null : new DateTime (dtoInpatient.Dischargedate));
    } 
    catch (ParseException e) 
    {
        voPasContact.setDischargeDateTime(null);
        e.printStackTrace();
    }

    PatientShort voPatientShort = new PatientShort();

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoInpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);

    voPatientShort.setName(dtoInpatient.Snm, dtoInpatient.Fnm1, null);  

    voPatientShort.addId(PatIdType.HOSPNUM, dtoInpatient.Hospnum);                      
    voPatientShort.addId(PatIdType.CHARTNUM, dtoInpatient.Chartnum);                        

    voPatientShort.setDob(dtoInpatient.Dob == "" ? null : new PartialDate(dtoInpatient.Dob));   

    if(dtoInpatient.Dod != null && dtoInpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoInpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    voPatientShort.calculateAge();
    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoInpatient.Sex));
    voPasContact.setPatient(voPatientShort);            

    voPasContact.setGPCode(dtoInpatient.Gpcode); 

    if (dtoInpatient.Documentstatus != ""  && Integer.valueOf(dtoInpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoInpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }
}
项目:openmaxims-linux    文件:PatientListsImpl.java   
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
    String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();           
    LocShortVo voLoc = new LocShortVo();        
    OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);

    voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
    voPasContact.setLocation(voLoc);

    HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);

    MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
    voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);


    Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);         

    voPasContact.setSpecialty(specialty);           

    //Contact Number
    voPasContact.setContactNumber(dtoOutpatient.Contactno);
    try {
        voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
    } catch (ParseException e) {
        voPasContact.setAppointmentDateTime(null);
    }

    PatientShort voPatientShort = new PatientShort();
    voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);    

    voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);                     
    voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);                       

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));  
    else
        voPatientShort.setDob(null);

    if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
    {
        try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
        } catch (ParseException e2) {
            e2.printStackTrace();
        }
    }

    if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
        voPatientShort.calculateAge();

    voPatientShort.setWard(voPasContact.getLocation());     
    voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
    voPasContact.setPatient(voPatientShort);            
    voPasContact.setGPCode(dtoOutpatient.Gpcode);

    if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
    { 
        voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
    }
    else                
    {
        if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
            voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
        else
            voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
    }       
}
项目:openmaxims-linux    文件:ADTImpl.java   
/**
*   Populates as many of the PasEvent fields as it can from the PasContact
*  CareContext,IsVip,ReferringGP,SourceOfReferral are left as null 
*  EventDateTime depends on whether we are listing inpatients or outpatients and
*  is populated external to this method.
*/
public PasEventVo createPasEvent(DateTime eventDateTime, PatientRefVo voRefPatient, PasContactVo voPasContact) throws StaleObjectException, UniqueKeyViolationException   
{
    PasEventVo voPasEvent = new PasEventVo();

    voPasEvent.setEventDateTime(eventDateTime);

    if (voPasContact.getConsultant() != null)
    {
        MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo(voPasContact.getConsultant().getID_Hcp(), voPasContact.getConsultant().getVersion_Hcp());
        medLite.setMos(voPasContact.getConsultant().getMos());
        voPasEvent.setConsultant(medLite);          
    }
    voPasEvent.setLocation(voPasContact.getLocation());
    voPasEvent.setSpecialty(voPasContact.getSpecialty());
    voPasEvent.setPasEventId(voPasContact.getContactNumber());
    //      voPasEvent.setPatient(voPasContact.getPatient());
    GpLiteToPracticeLiteVo voGpLiteToPracList = synchronizeGPPracticeDetails(voPasContact.getGPCode());
    if (voGpLiteToPracList != null)
    {
        voPasEvent.setReferringGP(voGpLiteToPracList.getGp());
        if (voGpLiteToPracList.getPracticeIsNotNull() && voGpLiteToPracList.getPractice().getSurgeriesIsNotNull() && voGpLiteToPracList.getPractice().getSurgeries().size() > 0)
            voPasEvent.setReferringGpSurgery(voGpLiteToPracList.getPractice().getSurgeries().get(0));
    }

    if (voPasContact.getAppointmentDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.OUTPATIENT);
    else if (voPasContact.getDischargeDateTimeIsNotNull())
        voPasEvent.setEventType(PasEventType.INPATIENT);

    DomainFactory factory = getDomainFactory();
    PASEvent domPasEvent = PasEventVoAssembler.extractPASEvent(factory, voPasEvent);

    ims.core.patient.domain.objects.Patient domPatient = (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, voRefPatient.getID_Patient().intValue()); 
    domPasEvent.setPatient(domPatient);
    try 
    {
        factory.save(domPasEvent);
    }
    catch (UnqViolationUncheckedException e)
    {
        throw new UniqueKeyViolationException(e.getMessage());
    }

    return PasEventVoAssembler.create(domPasEvent);
}
项目:openmaxims-linux    文件:HcpAdminImpl.java   
public MedicWithMappingsLiteVo getMedicMedicMappingsByPasCode(String pasCode)
{
    return getMedicMedicMappingsByExternalCode(TaxonomyType.PAS, pasCode);
}