Java 类ims.clinical.vo.EDischargeSTHKSummaryVo 实例源码

项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientDocumentVo vo = new PatientDocumentVo();
            vo.setPatient(patVo);                   
            vo.setCareContext(summaryVo.getCareContext());                  

            vo.setName(docName);
            vo.setServerDocument(serverDocumentVo);
            vo.setCreationType(DocumentCreationType.GENERATED);                     
            vo.setCategory(category);

            vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
            vo.setRecordingDateTime(new DateTime());
            vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
            vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext()));

            return vo;                  
        }           
    }

    return null;    
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
    /*WDEV-13536
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("The logged in user is not a HCP, and so cannot Start an eDischarge.");
        return;
    }*/

    //WDEV-12920 - check for SOE
    EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    if(summary != null && summary.getID_SummaryIsNotNull())
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getLocalContext().setSelectedSummaryInstance(summary);
        updateControlState(TAB_SUPP);
    }
    else
    {
        form.getLocalContext().setSelectedSummaryInstance(new EDischargeSTHKSummaryVo());
    }

    form.lyrDetails().tabPageSummary().ccSummary().initialise(form.getLocalContext().getSelectedSummaryInstance());
}
项目:AvoinApotti    文件:EDischargeSummarySthkComponentImpl.java   
/**
* saveSummary
*/
public EDischargeSTHKSummaryVo saveSummaryAndDischargeDetails(EDischargeSTHKSummaryVo summary, DischargeDetailsVo dischargeDetails) throws StaleObjectException, DomainInterfaceException
{
    if (summary == null)
        throw new CodingRuntimeException("summary is null in method saveSummary");
    if (!summary.isValidated())
        throw new CodingRuntimeException("summary has not been validated in method saveSummary");

    if (dischargeDetails != null)
    {
        IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class);
        summary.setDischargeDetails(impl.saveDischargeDetails(dischargeDetails));
    }

    DomainFactory factory = getDomainFactory();
    Summary doSummary = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summary);
    factory.save(doSummary);

    return EDischargeSTHKSummaryVoAssembler.create(doSummary);
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientDocumentVo vo = new PatientDocumentVo();
            vo.setPatient(patVo);                   
            vo.setCareContext(summaryVo.getCareContext());                  

            vo.setName(docName);
            vo.setServerDocument(serverDocumentVo);
            vo.setCreationType(DocumentCreationType.GENERATED);                     
            vo.setCategory(category);

            vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
            vo.setRecordingDateTime(new DateTime());
            vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
            vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext()));

            return vo;                  
        }           
    }

    return null;    
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
    /*WDEV-13536
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("The logged in user is not a HCP, and so cannot Start an eDischarge.");
        return;
    }*/

    //WDEV-12920 - check for SOE
    EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    if(summary != null && summary.getID_SummaryIsNotNull())
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getLocalContext().setSelectedSummaryInstance(summary);
        updateControlState(TAB_SUPP);
    }
    else
    {
        form.getLocalContext().setSelectedSummaryInstance(new EDischargeSTHKSummaryVo());
    }

    form.lyrDetails().tabPageSummary().ccSummary().initialise(form.getLocalContext().getSelectedSummaryInstance());
}
项目:openMAXIMS    文件:EDischargeSummarySthkComponentImpl.java   
/**
* saveSummary
*/
public EDischargeSTHKSummaryVo saveSummaryAndDischargeDetails(EDischargeSTHKSummaryVo summary, DischargeDetailsVo dischargeDetails) throws StaleObjectException, DomainInterfaceException
{
    if (summary == null)
        throw new CodingRuntimeException("summary is null in method saveSummary");
    if (!summary.isValidated())
        throw new CodingRuntimeException("summary has not been validated in method saveSummary");

    if (dischargeDetails != null)
    {
        IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class);
        summary.setDischargeDetails(impl.saveDischargeDetails(dischargeDetails));
    }

    DomainFactory factory = getDomainFactory();
    Summary doSummary = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summary);
    factory.save(doSummary);

    return EDischargeSTHKSummaryVoAssembler.create(doSummary);
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientDocumentVo vo = new PatientDocumentVo();
            vo.setPatient(patVo);                   
            vo.setCareContext(summaryVo.getCareContext());                  

            vo.setName(docName);
            vo.setServerDocument(serverDocumentVo);
            vo.setCreationType(DocumentCreationType.GENERATED);                     
            vo.setCategory(category);

            vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
            vo.setRecordingDateTime(new DateTime());
            vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
            vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext()));

            return vo;                  
        }           
    }

    return null;    
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
    /*WDEV-13536
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("The logged in user is not a HCP, and so cannot Start an eDischarge.");
        return;
    }*/

    //WDEV-12920 - check for SOE
    EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    if(summary != null && summary.getID_SummaryIsNotNull())
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getLocalContext().setSelectedSummaryInstance(summary);
        updateControlState(TAB_SUPP);
    }
    else
    {
        form.getLocalContext().setSelectedSummaryInstance(new EDischargeSTHKSummaryVo());
    }

    form.lyrDetails().tabPageSummary().ccSummary().initialise(form.getLocalContext().getSelectedSummaryInstance());
}
项目:openMAXIMS    文件:EDischargeSummarySthkComponentImpl.java   
/**
* saveSummary
*/
public EDischargeSTHKSummaryVo saveSummaryAndDischargeDetails(EDischargeSTHKSummaryVo summary, DischargeDetailsVo dischargeDetails) throws StaleObjectException, DomainInterfaceException
{
    if (summary == null)
        throw new CodingRuntimeException("summary is null in method saveSummary");
    if (!summary.isValidated())
        throw new CodingRuntimeException("summary has not been validated in method saveSummary");

    if (dischargeDetails != null)
    {
        IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class);
        summary.setDischargeDetails(impl.saveDischargeDetails(dischargeDetails));
    }

    DomainFactory factory = getDomainFactory();
    Summary doSummary = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summary);
    factory.save(doSummary);

    return EDischargeSTHKSummaryVoAssembler.create(doSummary);
}
项目:openmaxims-linux    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private PatientDocumentVo populatePatientDocumentVo(PatientEdischargeBatchVo patVo, ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientDocumentVo vo = new PatientDocumentVo();
            vo.setPatient(patVo);                   
            vo.setCareContext(summaryVo.getCareContext());                  

            vo.setName(docName);
            vo.setServerDocument(serverDocumentVo);
            vo.setCreationType(DocumentCreationType.GENERATED);                     
            vo.setCategory(category);

            vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
            vo.setRecordingDateTime(new DateTime());
            vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);
            vo.setResponsibleHCP(getResponsibleHCPForCareContext(summaryVo.getCareContext()));

            return vo;                  
        }           
    }

    return null;    
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onBtnStartClick() throws ims.framework.exceptions.PresentationLogicException
{
    /*WDEV-13536
    if (domain.getHcpLiteUser() == null)
    {
        engine.showMessage("The logged in user is not a HCP, and so cannot Start an eDischarge.");
        return;
    }*/

    //WDEV-12920 - check for SOE
    EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    if(summary != null && summary.getID_SummaryIsNotNull())
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        form.getLocalContext().setSelectedSummaryInstance(summary);
        updateControlState(TAB_SUPP);
    }
    else
    {
        form.getLocalContext().setSelectedSummaryInstance(new EDischargeSTHKSummaryVo());
    }

    form.lyrDetails().tabPageSummary().ccSummary().initialise(form.getLocalContext().getSelectedSummaryInstance());
}
项目:openmaxims-linux    文件:EDischargeSummarySthkComponentImpl.java   
/**
* saveSummary
*/
public EDischargeSTHKSummaryVo saveSummaryAndDischargeDetails(EDischargeSTHKSummaryVo summary, DischargeDetailsVo dischargeDetails) throws StaleObjectException, DomainInterfaceException
{
    if (summary == null)
        throw new CodingRuntimeException("summary is null in method saveSummary");
    if (!summary.isValidated())
        throw new CodingRuntimeException("summary has not been validated in method saveSummary");

    if (dischargeDetails != null)
    {
        IEDischargeHelper impl = (IEDischargeHelper)getDomainImpl(EDischargeHelper.class);
        summary.setDischargeDetails(impl.saveDischargeDetails(dischargeDetails));
    }

    DomainFactory factory = getDomainFactory();
    Summary doSummary = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summary);
    factory.save(doSummary);

    return EDischargeSTHKSummaryVoAssembler.create(doSummary);
}
项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
public EDischargeSTHKSummaryVo saveSummary(EDischargeSTHKSummaryVo summaryVo) throws StaleObjectException
{
    if(summaryVo == null) 
        throw new CodingRuntimeException("summaryVo is null");

    if (!summaryVo.isValidated()) 
        throw new DomainRuntimeException("summaryVo not validated");


    DomainFactory factory = getDomainFactory();
    Summary doSumm = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summaryVo);           
    factory.save(doSumm);           
    return EDischargeSTHKSummaryVoAssembler.create(doSumm);
}
项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private void rollback(EDischargeSTHKSummaryVo summaryVo, PatientDocumentVo document, DocumentCategory category) throws ForeignKeyViolationException, StaleObjectException 
{       
    DomainFactory factory = getDomainFactory();

    Summary boSUMM = (Summary) factory.getDomainObject(Summary.class, summaryVo.getID_Summary());
    summaryVo =  EDischargeSTHKSummaryVoAssembler.create(boSUMM);

    PatientDocumentVoCollection documents = summaryVo.getDischargeDocuments();
    documents.remove(document);
    summaryVo.setDischargeDocuments(documents);             

    if (category.equals(DocumentCategory.DISCHARGE_SUMMARY))
        summaryVo.setDischargeLetterStatus(DischargeLetterStatus.IN_PROGRESS);
    else if (category.equals(DocumentCategory.DISCHARGE_SUPPLEMENTARY)) 
        summaryVo.setDischargeSupplementaryLetterStatus(DischargeSupplementaryLetterStatus.REQUIRED);

    String[] str = summaryVo.validate();        
    if (str != null && str.length > 0)
    {       
        LOG.error("summaryVo is not validate");
        return;
    }

    summaryVo = saveSummary(summaryVo);
    try
    {
        deletePatientDocument(document);
    }
    catch(Exception e)
    {
        throw new StaleObjectException(null);
    }

    getDomainFactory().getTransaction().commit();
    getDomainFactory().setTransaction(null);                                
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    form.getLocalContext().setLastEvent(null);
    if(formName.equals(form.getForms().Clinical.EDischargeStartDialog) && result.equals(DialogResult.OK))
    {
        //WDEV-12920 - check for SOE
        if(form.getLocalContext().getSelectedInstance() == null || (form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() == null))
        {
            EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());

            if(summary != null && summary.getID_SummaryIsNotNull()) //SOE
            {
                engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
                form.getLocalContext().setSelectedInstance(summary);
                form.getLocalContext().setLastEvent(SummaryEventType.CREATESUMMARY);
                form.fireCustomControlValueChanged();
                open();
                return;
            }
        }

        //WDEV-12696 - simulate SOE
        if(form.getLocalContext().getAllowChangeNeoNatalPlasticsIsNotNull() && form.getLocalContext().getAllowChangeNeoNatalPlastics() && Boolean.FALSE.equals(domain.allowChangeNeoNatalPlastics(form.getLocalContext().getSelectedInstance())))
        {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
            open();
            return;
        }

        if(populateDischargeandSummary())
            open();
    }
}
项目:AvoinApotti    文件:Logic.java   
private void populateScreenFromData(EDischargeSTHKSummaryVo voSummary)
{
    clearScreen();
    form.getGlobalContext().Clinical.setEDischargeStart(null);

    if(voSummary == null)
        return;

    form.dtimAdmissionDateTime().setValue(voSummary.getAdmissionDateTime());
    if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
    {
        form.dteEdd().setValue(form.getGlobalContext().Core.getCurrentCareContext().getEstimatedDischargeDate());
        //WDEV-11479
        if(form.getGlobalContext().Core.getCurrentCareContext().getResponsibleHCPIsNotNull())
            form.txtResponsibleClinician().setValue(form.getGlobalContext().Core.getCurrentCareContext().getResponsibleHCP().toString());
    }

    if(voSummary.getTTAStatusIsNotNull())
        form.txtTTAStatus().setValue(voSummary.getTTAStatus().getText());

    if(voSummary.getSummaryDetailsIsNotNull())
    {
        for(int i=0;i<voSummary.getSummaryDetails().size();i++)
        {
            grdSummaryRow row = form.grdSummary().getRows().newRow();

            if(voSummary.getSummaryDetails().get(i).getSectionIsNotNull())
                row.setColSummary(voSummary.getSummaryDetails().get(i).getSection().getText());
            if(voSummary.getSummaryDetails().get(i).getProgressStatusIsNotNull())
                row.setColStatus(voSummary.getSummaryDetails().get(i).getProgressStatus().getText());
        }
    }

    form.getGlobalContext().Clinical.setEDischargeStart(new EDischargeStartVo());
    form.getGlobalContext().Clinical.getEDischargeStart().setAdditonalClinicalInfo(voSummary.getAdditonalClinicalInfo());
    form.getGlobalContext().Clinical.getEDischargeStart().setHasHadAnyProceduresPerformed(voSummary.getHasHadAnyProceduresPerformed());

}
项目:AvoinApotti    文件:Logic.java   
/**
 * component interface methods
 */

public void initialise(EDischargeSTHKSummaryVo voSummary)
{
    form.getLocalContext().setSelectedInstance(voSummary);
    form.setMode(FormMode.VIEW);
    open();
}
项目:AvoinApotti    文件:Logic.java   
public void initialise(EDischargeSTHKSummaryVo dischargeSummary)
{
    // Set DischargeSummary in the local context
    form.getLocalContext().setDischargeSummary(dischargeSummary);

    initialise();
}
项目:AvoinApotti    文件:Logic.java   
public void initialise(EDischargeSTHKSummaryVo dischargeSummary)
{
    // Set discharge summary to local context
    form.getLocalContext().setDischargeSummary(dischargeSummary);

    initialise();

    open();
}
项目:AvoinApotti    文件:EDischargeSTHKImpl.java   
public EDischargeSTHKSummaryVo getSummaryByCareContext(CareContextRefVo careContext)
{
    if (careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext is null or id not provided in method getNeonatalByCareContext");

    DomainFactory factory = getDomainFactory();
    List nnItems =  factory.find("from Summary ds where ds.careContext.id = " + careContext.getID_CareContext());

    if(nnItems != null && nnItems.size() > 0)
        return EDischargeSTHKSummaryVoAssembler.create((Summary) nnItems.get(0));

    return null;
}
项目:AvoinApotti    文件:EDischargePatientReadyToLeaveSTHKComponentImpl.java   
public EDischargeSTHKSummaryVo getCurrentSummary(CareContextRefVo ccRefVo) 
{
    if(ccRefVo == null)
        throw new CodingRuntimeException("ccRefVo Filter not provided for list call. ");

    if(ccRefVo != null)
    {
        DomainFactory factory = getDomainFactory();
        StringBuffer hql = new StringBuffer(" from Summary summ where "); 
        String andStr = " ";

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

        hql.append(andStr + " summ.careContext.id = :careContextId");
            markers.add("careContextId");
        values.add(ccRefVo.getID_CareContext());
        andStr = " and ";   

        List list = factory.find(hql.toString(), markers,values);
        if(list != null && list.size() > 0)
        { 
            EDischargeSTHKSummaryVoCollection voColl = EDischargeSTHKSummaryVoAssembler.createEDischargeSTHKSummaryVoCollectionFromSummary(list);
            if(voColl != null && voColl.size() > 0)
                return voColl.get(0);
        }
    }
    return null;
}
项目:AvoinApotti    文件:EDischargeFuturePlanSthkComponentImpl.java   
public DischargeFuturePlanSthkVo saveFuturePlan(DischargeFuturePlanSthkVo futurePlan, EDischargeSTHKSummaryVo dischargeSummary)
                                                                                                                throws  StaleObjectException,
                                                                                                                        ForeignKeyViolationException,
                                                                                                                        UniqueKeyViolationException
{
    // Check for null VO passed to save
    if (futurePlan == null)
        throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Can not save a null object");

    // Check if the VO is validated
    if (!futurePlan.isValidated())
        throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Value object to save is not validated");


    // Extract domain object needed
    DomainFactory domainFactory = getDomainFactory();
    FuturePlan futurePlanDomObj = DischargeFuturePlanSthkVoAssembler.extractFuturePlan(domainFactory, futurePlan);

    // Save domain object
    domainFactory.save(futurePlanDomObj);

    futurePlan = DischargeFuturePlanSthkVoAssembler.create(futurePlanDomObj);

    IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class);
    impl.updateSummaryIfRequired(futurePlan, dischargeSummary, getDomainFactory());

    // Return a refreshed version of the VO
    return futurePlan;
}
项目:AvoinApotti    文件:EDischargeSummarySthkComponentImpl.java   
public ims.clinical.vo.EDischargeSTHKSummaryVo getSummaryByCareContext(ims.core.admin.vo.CareContextRefVo careContext)
{
    if (careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext is null or id not provided in method getNeonatalByCareContext");

    DomainFactory factory = getDomainFactory();
    List nnItems =  factory.find("from Summary ds where ds.careContext.id = " + careContext.getID_CareContext());

    if(nnItems != null && nnItems.size() > 0)
        return EDischargeSTHKSummaryVoAssembler.create((Summary) nnItems.get(0));

    return null;
}
项目:AvoinApotti    文件:EDischargeMedicationOnAdmissionComponentImpl.java   
/**
 * 
 */
public MedicationOnAdmissionAndChangesLiteVo saveMedication(MedicationOnAdmissionAndChangesLiteVo medication, EDischargeSTHKSummaryVo dischargeSummary)
                                                                                                                                throws  StaleObjectException,
                                                                                                                                        ForeignKeyViolationException,
                                                                                                                                        UniqueKeyViolationException
{
    // Check for null VO passed to save
    if (medication == null)
        throw new DomainRuntimeException("DOMAIN saveMedication() - Can not save a null object");

    // Check if the VO is validated
    if (!medication.isValidated())
        throw new DomainRuntimeException("DOMAIN saveMedication() - Value object to save is not validated");


    // Extract domain object needed
    DomainFactory domainFactory = getDomainFactory();
    MedicationOnAdmissionAndChanges medicationDomObj = MedicationOnAdmissionAndChangesLiteVoAssembler.extractMedicationOnAdmissionAndChanges(domainFactory, medication);

    // Save domain object
    domainFactory.save(medicationDomObj);

    medication = MedicationOnAdmissionAndChangesLiteVoAssembler.create(medicationDomObj);

    IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class);
    impl.updateSummaryIfRequired(medication, dischargeSummary, getDomainFactory());

    // Return a refreshed version of the VO
    return medication;
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKImpl.java   
public EDischargeSTHKSummaryVo saveSummary(EDischargeSTHKSummaryVo summaryVo) throws StaleObjectException
{
    if(summaryVo == null) 
        throw new CodingRuntimeException("summaryVo is null");

    if (!summaryVo.isValidated()) 
        throw new DomainRuntimeException("summaryVo not validated");


    DomainFactory factory = getDomainFactory();
    Summary doSumm = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summaryVo);           
    factory.save(doSumm);           
    return EDischargeSTHKSummaryVoAssembler.create(doSumm);
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKImpl.java   
private void rollback(EDischargeSTHKSummaryVo summaryVo, PatientDocumentVo document, DocumentCategory category) throws ForeignKeyViolationException, StaleObjectException 
{       
    DomainFactory factory = getDomainFactory();

    Summary boSUMM = (Summary) factory.getDomainObject(Summary.class, summaryVo.getID_Summary());
    summaryVo =  EDischargeSTHKSummaryVoAssembler.create(boSUMM);

    PatientDocumentVoCollection documents = summaryVo.getDischargeDocuments();
    documents.remove(document);
    summaryVo.setDischargeDocuments(documents);             

    if (category.equals(DocumentCategory.DISCHARGE_SUMMARY))
        summaryVo.setDischargeLetterStatus(DischargeLetterStatus.IN_PROGRESS);
    else if (category.equals(DocumentCategory.DISCHARGE_SUPPLEMENTARY)) 
        summaryVo.setDischargeSupplementaryLetterStatus(DischargeSupplementaryLetterStatus.REQUIRED);

    String[] str = summaryVo.validate();        
    if (str != null && str.length > 0)
    {       
        LOG.error("summaryVo is not validate");
        return;
    }

    summaryVo = saveSummary(summaryVo);
    try
    {
        deletePatientDocument(document);
    }
    catch(Exception e)
    {
        throw new StaleObjectException(null);
    }

    getDomainFactory().getTransaction().commit();
    getDomainFactory().setTransaction(null);                                
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKImpl.java   
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category)
{       
    if (summaryVo != null)
    {
        if (summaryVo.getCareContextIsNotNull())
        {
            PatientLiteVo patient = getPatientByCareContext(summaryVo.getCareContext());

            if (patient != null)
            {
                PatientDocumentVo vo = new PatientDocumentVo();
                vo.setPatient(patient);                 
                vo.setCareContext(summaryVo.getCareContext());                  

                vo.setName(docName);
                vo.setServerDocument(serverDocumentVo);
                vo.setCreationType(DocumentCreationType.GENERATED);                     
                vo.setCategory(category);

                vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null);
                vo.setRecordingDateTime(new DateTime());
                vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE);

                return vo;                  
            }               
        }           
    }

    return null;    
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKFormImpl.java   
public EDischargeSTHKSummaryVo saveSummary(EDischargeSTHKSummaryVo summaryVo) throws StaleObjectException
{
    if(summaryVo == null) 
        throw new CodingRuntimeException("summaryVo is null");

    if (!summaryVo.isValidated()) 
        throw new DomainRuntimeException("summaryVo not validated");


    DomainFactory factory = getDomainFactory();
    Summary doSumm = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summaryVo);           
    factory.save(doSumm);           
    return EDischargeSTHKSummaryVoAssembler.create(doSumm);
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKFormImpl.java   
private void rollback(EDischargeSTHKSummaryVo summaryVo, PatientDocumentVo document, DocumentCategory category) throws ForeignKeyViolationException, StaleObjectException 
{       
    DomainFactory factory = getDomainFactory();

    Summary boSUMM = (Summary) factory.getDomainObject(Summary.class, summaryVo.getID_Summary());
    summaryVo =  EDischargeSTHKSummaryVoAssembler.create(boSUMM);

    PatientDocumentVoCollection documents = summaryVo.getDischargeDocuments();
    documents.remove(document);
    summaryVo.setDischargeDocuments(documents);             

    if (category.equals(DocumentCategory.DISCHARGE_SUMMARY))
        summaryVo.setDischargeLetterStatus(DischargeLetterStatus.IN_PROGRESS);
    else if (category.equals(DocumentCategory.DISCHARGE_SUPPLEMENTARY)) 
        summaryVo.setDischargeSupplementaryLetterStatus(DischargeSupplementaryLetterStatus.REQUIRED);

    String[] str = summaryVo.validate();        
    if (str != null && str.length > 0)
    {       
        LOG.error("summaryVo is not validate");
        return;
    }

    summaryVo = saveSummary(summaryVo);
    try
    {
        deletePatientDocument(document);
    }
    catch(Exception e)
    {
        throw new StaleObjectException(null);
    }

    getDomainFactory().getTransaction().commit();
    getDomainFactory().setTransaction(null);                                
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    form.getLocalContext().setLastEvent(null);
    if(formName.equals(form.getForms().Clinical.EDischargeStartDialog) && result.equals(DialogResult.OK))
    {
        //WDEV-12920 - check for SOE
        if(form.getLocalContext().getSelectedInstance() == null || (form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() == null))
        {
            EDischargeSTHKSummaryVo summary = domain.getSummaryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());

            if(summary != null && summary.getID_SummaryIsNotNull()) //SOE
            {
                engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
                form.getLocalContext().setSelectedInstance(summary);
                form.getLocalContext().setLastEvent(SummaryEventType.CREATESUMMARY);
                form.fireCustomControlValueChanged();
                open();
                return;
            }
        }

        //WDEV-12696 - simulate SOE
        if(form.getLocalContext().getAllowChangeNeoNatalPlasticsIsNotNull() && form.getLocalContext().getAllowChangeNeoNatalPlastics() && Boolean.FALSE.equals(domain.allowChangeNeoNatalPlastics(form.getLocalContext().getSelectedInstance())))
        {
            engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
            open();
            return;
        }

        if(populateDischargeandSummary())
            open();
    }
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData(EDischargeSTHKSummaryVo voSummary)
{
    clearScreen();
    form.getGlobalContext().Clinical.setEDischargeStart(null);

    if(voSummary == null)
        return;

    form.dtimAdmissionDateTime().setValue(voSummary.getAdmissionDateTime());
    if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
    {
        form.dteEdd().setValue(form.getGlobalContext().Core.getCurrentCareContext().getEstimatedDischargeDate());
        //WDEV-11479
        if(form.getGlobalContext().Core.getCurrentCareContext().getResponsibleHCPIsNotNull())
            form.txtResponsibleClinician().setValue(form.getGlobalContext().Core.getCurrentCareContext().getResponsibleHCP().toString());
    }

    if(voSummary.getTTAStatusIsNotNull())
        form.txtTTAStatus().setValue(voSummary.getTTAStatus().getText());

    if(voSummary.getSummaryDetailsIsNotNull())
    {
        for(int i=0;i<voSummary.getSummaryDetails().size();i++)
        {
            grdSummaryRow row = form.grdSummary().getRows().newRow();

            if(voSummary.getSummaryDetails().get(i).getSectionIsNotNull())
                row.setColSummary(voSummary.getSummaryDetails().get(i).getSection().getText());
            if(voSummary.getSummaryDetails().get(i).getProgressStatusIsNotNull())
                row.setColStatus(voSummary.getSummaryDetails().get(i).getProgressStatus().getText());
        }
    }

    form.getGlobalContext().Clinical.setEDischargeStart(new EDischargeStartVo());
    form.getGlobalContext().Clinical.getEDischargeStart().setAdditonalClinicalInfo(voSummary.getAdditonalClinicalInfo());
    form.getGlobalContext().Clinical.getEDischargeStart().setHasHadAnyProceduresPerformed(voSummary.getHasHadAnyProceduresPerformed());

}
项目:openMAXIMS    文件:Logic.java   
/**
 * component interface methods
 */

public void initialise(EDischargeSTHKSummaryVo voSummary)
{
    form.getLocalContext().setSelectedInstance(voSummary);
    form.setMode(FormMode.VIEW);
    open();
}
项目:openMAXIMS    文件:Logic.java   
public void initialise(EDischargeSTHKSummaryVo dischargeSummary)
{
    // Set DischargeSummary in the local context
    form.getLocalContext().setDischargeSummary(dischargeSummary);

    initialise();
}
项目:openMAXIMS    文件:Logic.java   
public void initialise(EDischargeSTHKSummaryVo dischargeSummary)
{
    // Set discharge summary to local context
    form.getLocalContext().setDischargeSummary(dischargeSummary);

    initialise();

    open();
}
项目:openMAXIMS    文件:EDischargeSTHKImpl.java   
public EDischargeSTHKSummaryVo getSummaryByCareContext(CareContextRefVo careContext)
{
    if (careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext is null or id not provided in method getNeonatalByCareContext");

    DomainFactory factory = getDomainFactory();
    List nnItems =  factory.find("from Summary ds where ds.careContext.id = " + careContext.getID_CareContext());

    if(nnItems != null && nnItems.size() > 0)
        return EDischargeSTHKSummaryVoAssembler.create((Summary) nnItems.get(0));

    return null;
}
项目:openMAXIMS    文件:EDischargePatientReadyToLeaveSTHKComponentImpl.java   
public EDischargeSTHKSummaryVo getCurrentSummary(CareContextRefVo ccRefVo) 
{
    if(ccRefVo == null)
        throw new CodingRuntimeException("ccRefVo Filter not provided for list call. ");

    if(ccRefVo != null)
    {
        DomainFactory factory = getDomainFactory();
        StringBuffer hql = new StringBuffer(" from Summary summ where "); 
        String andStr = " ";

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

        hql.append(andStr + " summ.careContext.id = :careContextId");
            markers.add("careContextId");
        values.add(ccRefVo.getID_CareContext());
        andStr = " and ";   

        List list = factory.find(hql.toString(), markers,values);
        if(list != null && list.size() > 0)
        { 
            EDischargeSTHKSummaryVoCollection voColl = EDischargeSTHKSummaryVoAssembler.createEDischargeSTHKSummaryVoCollectionFromSummary(list);
            if(voColl != null && voColl.size() > 0)
                return voColl.get(0);
        }
    }
    return null;
}
项目:openMAXIMS    文件:EDischargeFuturePlanSthkComponentImpl.java   
public DischargeFuturePlanSthkVo saveFuturePlan(DischargeFuturePlanSthkVo futurePlan, EDischargeSTHKSummaryVo dischargeSummary)
                                                                                                                throws  StaleObjectException,
                                                                                                                        ForeignKeyViolationException,
                                                                                                                        UniqueKeyViolationException
{
    // Check for null VO passed to save
    if (futurePlan == null)
        throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Can not save a null object");

    // Check if the VO is validated
    if (!futurePlan.isValidated())
        throw new DomainRuntimeException("DOMAIN saveFuturePlan() - Value object to save is not validated");


    // Extract domain object needed
    DomainFactory domainFactory = getDomainFactory();
    FuturePlan futurePlanDomObj = DischargeFuturePlanSthkVoAssembler.extractFuturePlan(domainFactory, futurePlan);

    // Save domain object
    domainFactory.save(futurePlanDomObj);

    futurePlan = DischargeFuturePlanSthkVoAssembler.create(futurePlanDomObj);

    IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class);
    impl.updateSummaryIfRequired(futurePlan, dischargeSummary, getDomainFactory());

    // Return a refreshed version of the VO
    return futurePlan;
}
项目:openMAXIMS    文件:EDischargeSummarySthkComponentImpl.java   
public ims.clinical.vo.EDischargeSTHKSummaryVo getSummaryByCareContext(ims.core.admin.vo.CareContextRefVo careContext)
{
    if (careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext is null or id not provided in method getNeonatalByCareContext");

    DomainFactory factory = getDomainFactory();
    List nnItems =  factory.find("from Summary ds where ds.careContext.id = " + careContext.getID_CareContext());

    if(nnItems != null && nnItems.size() > 0)
        return EDischargeSTHKSummaryVoAssembler.create((Summary) nnItems.get(0));

    return null;
}
项目:openMAXIMS    文件:EDischargeMedicationOnAdmissionComponentImpl.java   
/**
 * 
 */
public MedicationOnAdmissionAndChangesLiteVo saveMedication(MedicationOnAdmissionAndChangesLiteVo medication, EDischargeSTHKSummaryVo dischargeSummary)
                                                                                                                                throws  StaleObjectException,
                                                                                                                                        ForeignKeyViolationException,
                                                                                                                                        UniqueKeyViolationException
{
    // Check for null VO passed to save
    if (medication == null)
        throw new DomainRuntimeException("DOMAIN saveMedication() - Can not save a null object");

    // Check if the VO is validated
    if (!medication.isValidated())
        throw new DomainRuntimeException("DOMAIN saveMedication() - Value object to save is not validated");


    // Extract domain object needed
    DomainFactory domainFactory = getDomainFactory();
    MedicationOnAdmissionAndChanges medicationDomObj = MedicationOnAdmissionAndChangesLiteVoAssembler.extractMedicationOnAdmissionAndChanges(domainFactory, medication);

    // Save domain object
    domainFactory.save(medicationDomObj);

    medication = MedicationOnAdmissionAndChangesLiteVoAssembler.create(medicationDomObj);

    IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class);
    impl.updateSummaryIfRequired(medication, dischargeSummary, getDomainFactory());

    // Return a refreshed version of the VO
    return medication;
}
项目:openMAXIMS    文件:DischargeSummaryScheduleSTHKFormImpl.java   
public EDischargeSTHKSummaryVo saveSummary(EDischargeSTHKSummaryVo summaryVo) throws StaleObjectException
{
    if(summaryVo == null) 
        throw new CodingRuntimeException("summaryVo is null");

    if (!summaryVo.isValidated()) 
        throw new DomainRuntimeException("summaryVo not validated");


    DomainFactory factory = getDomainFactory();
    Summary doSumm = EDischargeSTHKSummaryVoAssembler.extractSummary(factory, summaryVo);           
    factory.save(doSumm);           
    return EDischargeSTHKSummaryVoAssembler.create(doSumm);
}