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

项目:AvoinApotti    文件:Logic.java   
/**
 * @param voDocumentDetails
 * @param voPasEvent
 */
private void populateScreenPatientInfoFromData(CorrespondenceDetailsVo voDocumentDetails, PasEventVo voPasEvent)
{
    // show patient details

    Patient voPatient = null;
    PatientShort voPatientShort = null;

    if (voDocumentDetails != null)
        voPatient = domain.getPatientLocal(form.getLocalContext().getpasEventVo().getPatient());
    else if (voPasEvent != null)
        voPatientShort = voPasEvent.getPatient();

    if (null != voPatient)
    {
        populatePatientDetails(voPatient);
        if (voDocumentDetails.getPasEventIsNotNull())
            populateGPDetails(voPasEvent.getReferringGP(), voPasEvent.getReferringGpSurgery());

        form.getLocalContext().setPatientGP(voPatient.getGp());
    }
    else if (null != voPatientShort)
    {
        populatePatientDetails(voPatientShort);
    }
}
项目:AvoinApotti    文件:Logic.java   
private String getOtherAdressesTooltip(Patient pat)
{
    if (pat == null || pat.getAddresses() == null || pat.getAddresses().size() == 0)
    {
        if (form.getMode().equals(FormMode.VIEW))
            form.imbAddress().setVisible(false);
        else
            form.imbAddress().setVisible(true);
        return "No Other Addresses";
    }

    pat.getAddresses().sort();

    StringBuffer sb = new StringBuffer();
    sb.append(Textile.setBold("OTHER ADDRESSES ") + "\r");
    for (int i = 0; i < pat.getAddresses().size(); i++)
    {
        sb.append(pat.getAddresses().get(i).toDisplayString() + "\n");
    }

    return new Textile().process(sb.toString());
}
项目:AvoinApotti    文件:Logic.java   
@Override
//WDEV-14466
protected void onBtnCloseClick() throws PresentationLogicException
{
    if (engine.isDialog())
    {
        Patient patient;
        try
        {
            patient = domain.getPatient(form.getGlobalContext().Core.getPatientShort());
            form.getLocalContext().setPatient(patient);
        }
        catch (StaleObjectException e)
        {
            throw new FormOpenException("Failed to retrieve Patient due to StaleObjectException");
        }

        engine.close(DialogResult.CANCEL);
        save(patient, Boolean.FALSE, null, null,true);
        return;
    }
}
项目:AvoinApotti    文件:DemographicsImpl.java   
/**
 * Get's a specific Patient
 * @throws  
 * @throws UniqueKeyViolationException 
 */
public ims.core.vo.Patient getPatient(PatientShort patient) throws StaleObjectException
{
    if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("LOCAL"))
        return getLocalPatient(patient);
    else if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("DTO"))
    {
        try
        {
            return getDTOPatient(patient);
        }
        catch (UniqueKeyViolationException e)
        {
            throw new DomainRuntimeException(e);
        }
    }

    return null;
}
项目:AvoinApotti    文件:DemographicsImpl.java   
public Patient savePatient(Patient patient, Boolean fromInterface) throws UniqueKeyViolationException, StaleObjectException, DomainInterfaceException, IndexOutOfBoundsException
{
    DomainFactory factory = getDomainFactory();
    factory.setDirtyCheck(true);
    if (!patient.isValidated())
    {
        throw new DomainRuntimeException("Patient VO has not been validated!");
    }
    patient.getName().setUppers();
    if (patient.getOtherNames() != null)
    {
        for (int i = 0; i < patient.getOtherNames().size(); i++)
        {
            patient.getOtherNames().get(i).setUppers();
        }
    }
    return this.savePatientRecord(factory, patient, 1, fromInterface);
}
项目:AvoinApotti    文件:DemographicsImpl.java   
private void revertRTTStatus(Patient patient) throws StaleObjectException
{
    List <?> listofReferralsDO = getCatsReferralsToRevert(patient);

    if (listofReferralsDO == null || listofReferralsDO.size() == 0)
    {
        return;
    }

    for (int i=0; i<listofReferralsDO.size();i++)
    {
        if (listofReferralsDO.get(i) instanceof CatsReferral)
        {
            revertRTTforCatsReferral((CatsReferral) listofReferralsDO.get(i));
        }   
    }

}
项目:AvoinApotti    文件:DemographicsImpl.java   
private void saveRTTStatusForPatientRIP(Patient patient) throws StaleObjectException, DomainInterfaceException  //WDEV-18326
{
    List <?> listofReferralsDO = getCatsReferralsforPatient(patient);

    if (listofReferralsDO == null || listofReferralsDO.size() == 0)
    {
        return;
    }
    for (int i=0; i<listofReferralsDO.size();i++)
    {
        if (listofReferralsDO.get(i) instanceof CatsReferral)
        {
            updateRTTforCatsRef((CatsReferral) listofReferralsDO.get(i));
        }   
    }
}
项目:AvoinApotti    文件:DemographicsImpl.java   
public Boolean deletePatient(Patient patient) throws StaleObjectException
{
    if (!patient.isValidated())
    {
        throw new DomainRuntimeException("Patient VO has not been validated!");
    }
    if (patient.getID_Patient() == null)
        return Boolean.FALSE;

    DomainFactory factory = getDomainFactory();
    ims.core.patient.domain.objects.Patient patBo = (ims.core.patient.domain.objects.Patient) factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patient.getID_Patient().intValue());
    if (patBo == null)
        return Boolean.FALSE;

    // Check if patient is already inactive.
    if (patBo.isIsActive() != null && patBo.isIsActive().booleanValue() == false)
        return Boolean.TRUE;

    patBo.setIsActive(Boolean.FALSE);
    factory.save(patBo);
    return Boolean.TRUE;
}
项目:AvoinApotti    文件:DemographicsImpl.java   
public CaseNoteFolderVo getCaseNoteFolderLocation(String strHospNum) 
{
    ims.dto.client.Patient patRec = (ims.dto.client.Patient) getDTOInstance(ims.dto.client.Patient.class);

    patRec.Filter.clear();
    if (strHospNum == null)
    {
        throw new DomainRuntimeException("CaseNote Get call must contain valid interface identifier");
    }

    patRec.Filter.Hospnum = strHospNum;

    Result result = patRec.get();
    if (result != null)
    {
        return null;//WDEV-14481
    //  throw new DomainRuntimeException("Error getting Case Note details for patient " + strHospNum + "\nError - " + result.getMessage());
    }

    ims.core.vo.CaseNoteFolderVo voCaseNote = new CaseNoteFolderVo();
    voCaseNote.setLocation(patRec.DataCollection.get(0).Cflname);
    voCaseNote.setComments(patRec.DataCollection.get(0).Cflcomm);

    return (voCaseNote);
}
项目:AvoinApotti    文件:DemographicsImpl.java   
public ims.dto.client.Patient getCCODTOPatient(String pkey) throws DomainInterfaceException 
{
    if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()))
        return null;

    if(pkey == null)
        throw new DomainRuntimeException("Cannot get Patient for null pkey");

    ims.dto.client.Patient patient = (ims.dto.client.Patient)getDTOInstance(ims.dto.client.Patient.class);
    patient.Filter.clear();
    patient.Filter.Pkey = pkey;

    Result result = patient.get();
    if (result != null)
    {
        if(result.getId() == -2)
            throw new DomainInterfaceException("Error Getting Patient Details for pkey = " + pkey);

        throw new DomainInterfaceException(result.getMessage());
    }

    if (patient.DataCollection.count()!= 1)
        throw new DomainInterfaceException("Failed to get patient record.");

    return patient;
}
项目:AvoinApotti    文件:BedAdmissionComponentImpl.java   
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
    Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);

    Patient pat = null;
    try
    {
        pat = demographicsImpl.getPatient(patient);
    }
    catch (DomainRuntimeException e)
    {
        throw new DomainInterfaceException(e.getMessage());
    }

    return pat;
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBtnCopyPAClick() throws ims.framework.exceptions.PresentationLogicException
{
    if (form.getLocalContext().getPatientRefIsNotNull())
    {
        try
        {
            Patient pat = domain.getPatient(form.getLocalContext().getPatientRef());
            if (pat != null && pat.getAddressIsNotNull())
                form.lyrSupportServices().tabPageFamily().txtFamilyAddress().setValue(pat.getAddress().toDisplayStringForMultiLineTextBox());
        }
        catch ( StaleObjectException se)
        {
            engine.showMessage(se.getMessage());
        }
    }
    form.lyrSupportServices().tabPageFamily().btnCopyPA().setVisible(false);
}
项目:AvoinApotti    文件:Logic.java   
private void getPatient(PatientShort patient) throws FormOpenException
{
    Patient voPatient;
    try
    {
        voPatient = domain.getPatient(patient);
    }
    catch (StaleObjectException e)
    {
        // Try a second time. Only then fail.
        try
        {
            voPatient = domain.getPatient(patient);
        }
        catch (StaleObjectException e1)
        {
            throw new FormOpenException("Failed to retrieve Patient due to StaleObjectException");
        }
    }
    if (voPatient == null)
    {
        throw new FormOpenException("Data has been changed, Please perform another Patient Search");
    }

    form.getLocalContext().setPatient(voPatient);
}
项目:AvoinApotti    文件:VoMapper.java   
protected final void renderPatientVoToPID(Patient patVo, PID pid, ProviderSystemVo providerSystem) throws Exception
{
    LOG.debug("VoMapper renderPatientVoToPID: entry");
    if (patVo == null)
        return;

    renderPatientShortVoToPID(patVo, pid, providerSystem);

    for (int i = 0; i < patVo.getOtherNames().size(); i++)
    {
        renderNameVoToXPN(patVo.getOtherNames().get(i), pid.getPatientName(i+1),providerSystem);
    }

    for (int i = 0; i < patVo.getAddresses().size(); i++)
    {
        if (!patVo.getAddressIsNotNull()) // First instance will not have been populated if permanent address was null
            renderAddressVoToXAD(patVo.getAddresses().get(i), pid.getPatientAddress(i),providerSystem);
        else
            renderAddressVoToXAD(patVo.getAddresses().get(i), pid.getPatientAddress(i+1),providerSystem);
    }

    if (patVo.getMaritalStatusIsNotNull())
        pid.getMaritalStatus().getIdentifier().setValue(svc.getRemoteLookup(patVo.getMaritalStatus().getID(), providerSystem.getCodeSystem().getText()));

    LOG.debug("VoMapper renderPatientVoToPID: exit (" + pid.toString() + ")");
}
项目:AvoinApotti    文件:VoMapper.java   
protected void renderGPDetailsToPD1(Patient patient,PD1 pd1) throws Exception
{
    String gpCode=null;
    if(patient.getGpIsNotNull()&&patient.getGp().getCodeMappingsIsNotNull())
    {
        gpCode=patient.getGp().getNationalCode();
        pd1.getPatientPrimaryCareProviderNameIDNo(0).getIDNumber().setValue(gpCode);
    }
    if(patient.getGpIsNotNull()&&patient.getGp().getNameIsNotNull()&&patient.getGpIsNotNull()&&patient.getGp().getName().getSurnameIsNotNull())
    {
        pd1.getPatientPrimaryCareProviderNameIDNo(0).getFamilyName().getSurname().setValue(patient.getGp().getName().getSurname()); //
    }
    if(patient.getGpIsNotNull()&&patient.getGp().getNameIsNotNull()&&patient.getGpIsNotNull()&&patient.getGp().getName().getForenameIsNotNull())
    {
        pd1.getPatientPrimaryCareProviderNameIDNo(0).getGivenName().setValue(patient.getGp().getName().getForename());
    }

    if(patient.getGpSurgeryIsNotNull())
    {
        String practiceCode = orgLoc.getPracticeNationalCodeForSurgery(patient.getGpSurgery());
        pd1.getPatientPrimaryFacility(0).getOrganizationName().setValue(practiceCode);
    }
}
项目:AvoinApotti    文件:A28VoMapper.java   
protected Message processPatientUpdate(Message msg, ProviderSystemVo providerSystem, boolean includeNok) throws HL7Exception
{
    try
    {
        Patient patVo = savePatient(msg, providerSystem, includeNok);
        PV1 pv1 = (PV1) msg.get("PV1");
        if (ConfigFlag.HL7.INSTANTIATE_EPISODE_FROM_ADT.getValue())
        {
            createCareSpell(patVo, pv1,providerSystem);
        }
    }
    catch (Exception ex)
    {
        ex.printStackTrace();
        return HL7Utils.buildRejAck( msg.get("MSH"), "Exception. " + ex.getMessage(), HL7Errors.APP_INT_ERROR, toConfigItemArray(providerSystem.getConfigItems()));
    }


    Message ack = HL7Utils.buildPosAck( msg.get("MSH"), toConfigItemArray(providerSystem.getConfigItems()));
    return ack;
}
项目:AvoinApotti    文件:WebServicesIntegrationImpl.java   
private Patient getPatient(PatientShort patientShort) throws Exception 
{                       
    DomainSession domainSession = DomainSession.getSession();       
    DomainImplFlyweightFactory factory = DomainImplFlyweightFactory.getInstance();

    Object instance = factory.create(Class.forName("ims.core.domain.impl.DemographicsImpl"), domainSession);        
    Class<?> demographicsImpl = instance.getClass();

    final Method getPatientMethod = demographicsImpl.getDeclaredMethod("getPatient", PatientShort.class);   
    AccessController.doPrivileged(new PrivilegedAction<Object>() 
    {
        public Object run() 
        {
            getPatientMethod.setAccessible(true);
            return null;
        }
    });

    Object patient = getPatientMethod.invoke( instance, new Object[] { patientShort } );      

    return (Patient) patient;
    }
项目:AvoinApotti    文件:Logic.java   
private void selectPatient()
{
    PatientShort voPatShort = form.lyrPatDetails().tabPagePatientList().grdPatient().getValue();

    if(voPatShort != null && voPatShort.getID_Patient() == null)
    {
        Patient voPatient = replicatePatientIfNeeded(voPatShort);
        if(voPatient == null)
            return;
        else
            voPatShort = voPatient;
    }


    setPatientIntoContext(voPatShort);

    form.lyrPatDetails().tabPagePatientList().grdPatient().getSelectedRow().setValue(voPatShort);
    form.lyrPatDetails().showtabPagePatientDetails();
    populatePatientDetails(voPatShort);
    populateCollectDataGrid(voPatShort, getStatus());
}
项目:AvoinApotti    文件:Logic.java   
private void displaySelectedPatient() 
{
    if(form.getGlobalContext().Core.getPatientShortIsNotNull())
    {
        PatientShort patient = form.getGlobalContext().Core.getPatientShort();
        Patient voPatient = replicatePatientIfNeeded(patient);
        if(voPatient == null)
            return;

        if(voPatient != null)
        {
            addPatient(voPatient);
            form.lyrPatDetails().tabPagePatientList().grdPatient().setValue(voPatient);
            selectPatient();
            form.lyrPatDetails().showtabPagePatientDetails();
        }
    }
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public Patient getPatient(PatientShort patient, Boolean verify) throws StaleObjectException
{
    if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("LOCAL"))
           return getLocalPatient(patient, verify.booleanValue());
       else if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("DTO"))
       {
           try
           {
                return getDTOPatient(patient);
           }
           catch (UniqueKeyViolationException e)
           {
                throw new DomainRuntimeException(e);
           }
       }

    return null;

}
项目:openmaxims-linux    文件:DemographicsImpl.java   
public CaseNoteFolderVo getCaseNoteFolderLocation(String strHospNum) 
{
    ims.dto.client.Patient patRec = (ims.dto.client.Patient) getDTOInstance(ims.dto.client.Patient.class);

    patRec.Filter.clear();
    if (strHospNum == null)
    {
        throw new DomainRuntimeException("CaseNote Get call must contain valid interface identifier");
    }

    patRec.Filter.Hospnum = strHospNum;

    Result result = patRec.get();
    if (result != null)
    {
        return null;//WDEV-14481
    //  throw new DomainRuntimeException("Error getting Case Note details for patient " + strHospNum + "\nError - " + result.getMessage());
    }

    ims.core.vo.CaseNoteFolderVo voCaseNote = new CaseNoteFolderVo();
    voCaseNote.setLocation(patRec.DataCollection.get(0).Cflname);
    voCaseNote.setComments(patRec.DataCollection.get(0).Cflcomm);

    return (voCaseNote);
}
项目:openMAXIMS    文件:Logic.java   
private boolean selectPatient()
{
    PatientShort voPatShort = form.lyrPatDetails().tabPagePatientList().grdPatient().getValue();

    if(voPatShort != null && voPatShort.getID_Patient() == null)
    {
        Patient voPatient = replicatePatientIfNeeded(voPatShort);
        if(voPatient == null)
            return false;
        else
            voPatShort = voPatient;
    }
    else if (voPatShort == null)
        return false;

    setPatientIntoContext(voPatShort);

    form.lyrPatDetails().tabPagePatientList().grdPatient().getSelectedRow().setValue(voPatShort);
    form.lyrPatDetails().showtabPagePatientDetails();
    populatePatientDetails(voPatShort);
    populateCollectDataGrid(voPatShort, getStatus());

    return true;
}
项目:openMAXIMS    文件:PDSDemographicsImpl.java   
public Patient getPatient(PatientShort patient, Boolean verify) throws StaleObjectException
{
    if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("LOCAL"))
           return getLocalPatient(patient, verify.booleanValue());
       else if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("DTO"))
       {
           try
           {
                return getDTOPatient(patient);
           }
           catch (UniqueKeyViolationException e)
           {
                throw new DomainRuntimeException(e);
           }
       }

    return null;

}
项目:openMAXIMS    文件:Logic.java   
public NationalHealthCoverVo populateNationalHealthCover(Patient pat, NationalHealthCoverVo insurance)
{
    if(insurance == null) //WDEV-21921
    {
        insurance = new NationalHealthCoverVo();
    }

    if(form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().getVisible())
        insurance.setEligibility(form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().getValue());

    insurance.setEHICNumber(form.lyrDetails().tabOtherDetails().txtEhicNumber().getValue());
    insurance.setEHICExpiryDate(form.lyrDetails().tabOtherDetails().pdtEhicExpiryDate().getValue());
    insurance.setEHICCountry(form.lyrDetails().tabOtherDetails().cmbEhicCountry().getValue());
    insurance.setEHICInstitutionCode(form.lyrDetails().tabOtherDetails().cmbEhicInstitution().getValue());

    insurance.setMedicalCardNo(form.lyrDetails().tabOtherDetails().txtMedicalCardNo().getValue());
    insurance.setMedicalCardExpiryDate(form.lyrDetails().tabOtherDetails().pdtExpiryDate().getValue());
    insurance.setHealthActCategory(form.lyrDetails().tabOtherDetails().cmbEligibility().getValue());
    insurance.setMedicalCardProved(form.lyrDetails().tabOtherDetails().cmbProved().getValue());
    insurance.setEligibilityProof(form.lyrDetails().tabOtherDetails().txtEligibilityProof().getValue());

    return insurance;
}
项目:openmaxims-linux    文件:Logic.java   
private void getPatient(PatientShort patient) throws FormOpenException
{
    Patient voPatient;
    try
    {
        voPatient = domain.getPatient(patient);
    }
    catch (StaleObjectException e)
    {
        // Try a second time. Only then fail.
        try
        {
            voPatient = domain.getPatient(patient);
        }
        catch (StaleObjectException e1)
        {
            throw new FormOpenException("Failed to retrieve Patient due to StaleObjectException");
        }
    }
    if (voPatient == null)
    {
        throw new FormOpenException("Data has been changed, Please perform another Patient Search");
    }

    form.getLocalContext().setPatient(voPatient);
}
项目:openMAXIMS    文件:A28VoMapper.java   
private void populateEVN(ADT_A05 msg, Patient fullPatient) throws Exception //WDEV-22918
    {
        EVN evn = msg.getEVN();

        evn.getEventTypeCode().setValue("A28");
        //WDEV-22918
//      renderDateTimeVoToTS(new DateTime(), evn.getRecordedDateTime());
        if (fullPatient.getSysInfo() != null)
        {
            if (fullPatient.getSysInfo().getLastupdateDateTime() != null)
            {
                renderDateTimeVoToTS(fullPatient.getSysInfo().getLastupdateDateTime(), evn.getRecordedDateTime());
            }
            else if (fullPatient.getSysInfo().getCreationDateTime() != null)
            {
                renderDateTimeVoToTS(fullPatient.getSysInfo().getCreationDateTime(), evn.getRecordedDateTime());
            }
        } //WDEV-22918
    }
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData(Patient pat)
{
    if( pat == null )
        return;

    refreshGpDetails(pat.getGp(),pat.getPractice(), pat.getGpSurgery(), true/*!ConfigFlag.DOM.GP_USE_SURGERIES.getValue()*/);
    //form.cmbHealthBoard().setValue(pat.getHealthBoard()); //wdev-19176

    if(pat.getPDSPatientGPIsNotNull())
    {
        form.ccEffectiveDates().setEffectiveDates(pat.getPDSPatientGP().getBeffdate(), pat.getPDSPatientGP().getBetdate());
    }

    form.getLocalContext().setPrevPractice(pat.getPractice());

    updateGpSearchStatus();
}
项目:openMAXIMS    文件:Logic.java   
private void displaySelectedPatient() 
{
    if(form.getGlobalContext().Core.getPatientShortIsNotNull())
    {
        PatientShort patient = form.getGlobalContext().Core.getPatientShort();
        Patient voPatient = replicatePatientIfNeeded(patient);
        if(voPatient == null)
            return;

        if(voPatient != null)
        {
            addPatient(voPatient);
            form.lyrPatDetails().tabPagePatientList().grdPatient().setValue(voPatient);
            selectPatient();
            form.lyrPatDetails().showtabPagePatientDetails();
        }
    }
}
项目:openMAXIMS    文件:VoMapper.java   
protected final void renderPatientDetailsToPD1(Patient fullPatient, PD1 pd1, ProviderSystemVo providerSystem) throws Exception
{
    // PD1-2 Living arrangment (IS)
    // Note: Non-standard use of this field. It is being populated with the patient's occupation
    if (fullPatient != null
            && fullPatient.getOccupationIsNotNull())
    {
        pd1.getLivingArrangement().setValue(svc.getRemoteLookup(fullPatient.getOccupation().getID(),providerSystem.getCodeSystem().getText()));
    }
    else if(fullPatient!=null 
        &&fullPatient.getTxtOccupationIsNotNull()&&!fullPatient.getTxtOccupation().isEmpty()) //http://jira/browse/WDEV-22888
    {
        pd1.getLivingArrangement().setValue(fullPatient.getTxtOccupation());
    }

}
项目:openMAXIMS    文件:Logic.java   
private void getPatient(PatientShort patient) throws FormOpenException
{
    Patient voPatient;
    try
    {
        voPatient = domain.getPatient(patient);
    }
    catch (StaleObjectException e)
    {
        // Try a second time. Only then fail.
        try
        {
            voPatient = domain.getPatient(patient);
        }
        catch (StaleObjectException e1)
        {
            throw new FormOpenException("Failed to retrieve Patient due to StaleObjectException");
        }
    }
    if (voPatient == null)
    {
        throw new FormOpenException("Data has been changed, Please perform another Patient Search");
    }

    form.getLocalContext().setPatient(voPatient);
}
项目:openMAXIMS    文件:BedAdmissionComponentImpl.java   
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
    Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);

    Patient pat = null;
    try
    {
        pat = demographicsImpl.getPatient(patient);
    }
    catch (DomainRuntimeException e)
    {
        throw new DomainInterfaceException(e.getMessage());
    }

    return pat;
}
项目:openMAXIMS    文件:PDSDemographicsImpl.java   
private Integer calculateAgeAtAttendance(Patient voPatient, java.util.Date arrivalDate)
{
    PartialDate dob = voPatient.getDob();
    Date dod = voPatient.getDod();
    int patAge = 0;

    if (dob != null)
    {
        if (dod != null)
        {
            patAge = dod.yearDiff(dob);
        }
        else
        {
            patAge = arrivalDate != null ?  new ims.framework.utils.Age(dob, new Date(arrivalDate)).getYears() :  new ims.framework.utils.Age(dob, new Date()).getYears();
        }
        return new Integer(patAge);
    }           
    return null;    
}
项目:openmaxims-linux    文件:BedAdmissionComponentImpl.java   
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
    Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);

    Patient pat = null;
    try
    {
        pat = demographicsImpl.getPatient(patient);
    }
    catch (DomainRuntimeException e)
    {
        throw new DomainInterfaceException(e.getMessage());
    }

    return pat;
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public Patient saveDemographics(Patient patient, DeathDetailsVo deathDetails) throws StaleObjectException, UniqueKeyViolationException, DomainInterfaceException, IndexOutOfBoundsException
{
    //WDEV-19715 start
    ims.core.patient.domain.objects.Patient domPatient = getDomPatient(patient);
    Boolean wasPatientDodSavedPreviously = domPatient != null && domPatient.getDod() != null;
    Boolean wasPatientDodSavedNow = false;

    saveDeathDetails(deathDetails);

    wasPatientDodSavedNow =  (deathDetails == null || (wasPatientDodSavedPreviously && patient.getDod() != null)) ? null :  domPatient != null && patient.getDod() != null && domPatient.getDod() == null;

    if(patient != null)
        return savePatient(patient, false, wasPatientDodSavedNow);

    //WDEV-19715 --- ends here
    return null;

}
项目:openMAXIMS    文件:Logic.java   
public Patient getPrefCommLanguageAndCopyPatientOnCor(Patient pat)
{
    if( pat != null)
    {
        pat.setPrefCommLanguage(form.cmbPreferedLanguage().getValue());
        //WDEV-15957
        if(Group1Enumeration.rdoYes.equals(form.Group1().getValue()))
            pat.setCopyPatientOnCorrespondence(Boolean.TRUE);
        else if(Group1Enumeration.rdoNo.equals(form.Group1().getValue()))
            pat.setCopyPatientOnCorrespondence(Boolean.FALSE);
        else
            pat.setCopyPatientOnCorrespondence(null);

        if(pat.getCopyPatientOnCorrespondenceIsNotNull())
            pat.setCopyPatientOnCorrespondenceDate(form.dteEffectiveFromDate().getValue());
        else
            pat.setCopyPatientOnCorrespondenceDate(null);
    }

    return pat;
}
项目:openMAXIMS    文件:DemographicsImpl.java   
/**
 * Get's a specific Patient
 * @throws  
 * @throws UniqueKeyViolationException 
 */
public ims.core.vo.Patient getPatient(PatientShort patient) throws StaleObjectException
{
    if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("LOCAL"))
        return getLocalPatient(patient);
    else if (ConfigFlag.DOM.PATIENT_SEARCH_TYPE.getValue().equals("DTO"))
    {
        try
        {
            return getDTOPatient(patient);
        }
        catch (UniqueKeyViolationException e)
        {
            throw new DomainRuntimeException(e);
        }
    }

    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void selectPatient()
{
    PatientShort voPatShort = form.lyrPatDetails().tabPagePatientList().grdPatient().getValue();

    if(voPatShort != null && voPatShort.getID_Patient() == null)
    {
        Patient voPatient = replicatePatientIfNeeded(voPatShort);
        if(voPatient == null)
            return;
        else
            voPatShort = voPatient;
    }


    setPatientIntoContext(voPatShort);

    form.lyrPatDetails().tabPagePatientList().grdPatient().getSelectedRow().setValue(voPatShort);
    form.lyrPatDetails().showtabPagePatientDetails();
    populatePatientDetails(voPatShort);
    populateCollectDataGrid(voPatShort, getStatus());
}
项目:openMAXIMS    文件:PDSDemographicsImpl.java   
public ims.dto.client.Patient getCCODTOPatient(String pkey) throws DomainInterfaceException 
{
    if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue()))
        return null;

    if(pkey == null)
        throw new DomainRuntimeException("Cannot get Patient for null pkey");

    ims.dto.client.Patient patient = (ims.dto.client.Patient)getDTOInstance(ims.dto.client.Patient.class);
    patient.Filter.clear();
    patient.Filter.Pkey = pkey;

    Result result = patient.get();
    if (result != null)
    {
        if(result.getId() == -2)
            throw new DomainInterfaceException("Error Getting Patient Details for pkey = " + pkey);

        throw new DomainInterfaceException(result.getMessage());
    }

    if (patient.DataCollection.count()!= 1)
        throw new DomainInterfaceException("Failed to get patient record.");

    return patient;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * @param voDocumentDetails
 * @param voPasEvent
 */
private void populateScreenPatientInfoFromData(CorrespondenceDetailsVo voDocumentDetails, PasEventVo voPasEvent)
{
    // show patient details

    Patient voPatient = null;
    PatientShort voPatientShort = null;

    if (voDocumentDetails != null)
        voPatient = domain.getPatientLocal(form.getLocalContext().getpasEventVo().getPatient());
    else if (voPasEvent != null)
        voPatientShort = voPasEvent.getPatient();

    if (null != voPatient)
    {
        populatePatientDetails(voPatient);
        if (voDocumentDetails.getPasEventIsNotNull())
            populateGPDetails(voPasEvent.getReferringGP(), voPasEvent.getReferringGpSurgery());

        form.getLocalContext().setPatientGP(voPatient.getGp());
    }
    else if (null != voPatientShort)
    {
        populatePatientDetails(voPatientShort);
    }
}
项目:openmaxims-linux    文件:Logic.java   
private String getOtherAdressesTooltip(Patient pat)
{
    if (pat == null || pat.getAddresses() == null || pat.getAddresses().size() == 0)
    {
        if (form.getMode().equals(FormMode.VIEW))
            form.imbAddress().setVisible(false);
        else
            form.imbAddress().setVisible(true);
        return "No Other Addresses";
    }

    pat.getAddresses().sort();

    StringBuffer sb = new StringBuffer();
    sb.append(Textile.setBold("OTHER ADDRESSES ") + "\r");
    for (int i = 0; i < pat.getAddresses().size(); i++)
    {
        sb.append(pat.getAddresses().get(i).toDisplayString() + "\n");
    }

    return new Textile().process(sb.toString());
}