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

项目:AvoinApotti    文件:DocumentWorklistImpl.java   
public void deletePatientDocument(PatientDocumentVo patDoc) throws ForeignKeyViolationException, StaleObjectException
{

    PatientDocument patDO = PatientDocumentVoAssembler.extractPatientDocument(getDomainFactory(), patDoc);
    if (patDO == null )
        throw new StaleObjectException(patDO);

    long count  = getDomainFactory().countWithHQL("select count(patDoc.id) " +
            "from PatientDocument as patDoc where " +
            "(patDoc.id = :patDocId and patDoc.version=:patVersion)"
            ,new String[]{"patDocId","patVersion"},
            new Object[]{patDoc.getID_PatientDocument(),patDoc.getVersion_PatientDocument()});

    if (count == 0)
        throw new StaleObjectException(patDO);

    //getDomainFactory().delete(patDO);
    patDO.setIsRIE(true);//WDEV-15417
    getDomainFactory().save(patDO);//WDEV-15417
}
项目:AvoinApotti    文件:DocumentWorklistImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    if (doc == null)
        throw new StaleObjectException(doc);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:AvoinApotti    文件:DnaBatchUpdateImpl.java   
@SuppressWarnings("unchecked")
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralVoAssembler.extractCatsReferral(factory, catReferral);
        doCatsReferral.getReferralDocuments().add(doc); 

    doCatsReferral.setHasDocuments(Boolean.TRUE);

    //wdev-8288
    doCatsReferral.setHasDNAApptsForReview(Boolean.TRUE);

    factory.save(doCatsReferral);
}
项目:AvoinApotti    文件:PatientSpecialtyAssessmentsImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocument, PatientAssessmentVo patientAssessment) throws StaleObjectException
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("User assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = PatientAssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);
    factory.save(domainObject);

    return true;
}
项目:AvoinApotti    文件:PrintReportNoteDialogImpl.java   
/**
* savePatientDocument
*/
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralWizardVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralWizardVoAssembler.extractCatsReferral(factory, catReferral);
    if (catReferral != null) 
        doCatsReferral.getReferralDocuments().add(doc);                     

    factory.save(doCatsReferral);
}
项目:openMAXIMS    文件:DocumentWorklistImpl.java   
public void deletePatientDocument(PatientDocumentVo patDoc) throws ForeignKeyViolationException, StaleObjectException
{

    PatientDocument patDO = PatientDocumentVoAssembler.extractPatientDocument(getDomainFactory(), patDoc);
    if (patDO == null )
        throw new StaleObjectException(patDO);

    long count  = getDomainFactory().countWithHQL("select count(patDoc.id) " +
            "from PatientDocument as patDoc where " +
            "(patDoc.id = :patDocId and patDoc.version=:patVersion)"
            ,new String[]{"patDocId","patVersion"},
            new Object[]{patDoc.getID_PatientDocument(),patDoc.getVersion_PatientDocument()});

    if (count == 0)
        throw new StaleObjectException(patDO);

    //getDomainFactory().delete(patDO);
    patDO.setIsRIE(true);//WDEV-15417
    getDomainFactory().save(patDO);//WDEV-15417
}
项目:openMAXIMS    文件:DocumentWorklistImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    if (doc == null)
        throw new StaleObjectException(doc);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:openMAXIMS    文件:OutpatientListImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    if (doc == null)
        throw new StaleObjectException(doc);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:openMAXIMS    文件:DischargePlanning_AdviceMobilityEquipmentImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo patDocVo, EmergencyAttendanceForDischargeLetterVo emergencyAttendance) throws StaleObjectException
{
    if (patDocVo == null)
        throw new CodingRuntimeException("The PatientDocumentVo object to save cannot be null");

    if (!patDocVo.isValidated())
        throw new CodingRuntimeException("The PatientDocumentVo object to save was not validated.");

    DomainFactory domainFactory = getDomainFactory();

    PatientDocument patientDocumentDO = PatientDocumentVoAssembler.extractPatientDocument(domainFactory, patDocVo);

    domainFactory.save(patientDocumentDO);

    //WDEV-19441
    EmergencyAttendance domainEmergencyAttendance = EmergencyAttendanceForDischargeLetterVoAssembler.extractEmergencyAttendance(domainFactory, emergencyAttendance);
    domainFactory.save(domainEmergencyAttendance);

    return PatientDocumentVoAssembler.create(patientDocumentDO);
}
项目:openMAXIMS    文件:DnaBatchUpdateImpl.java   
@SuppressWarnings("unchecked")
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralVoAssembler.extractCatsReferral(factory, catReferral);
        doCatsReferral.getReferralDocuments().add(doc); 

    doCatsReferral.setHasDocuments(Boolean.TRUE);

    //wdev-8288
    //WDEV-22375 doCatsReferral.setHasDNAApptsForReview(Boolean.TRUE);

    factory.save(doCatsReferral);
}
项目:openMAXIMS    文件:PatientSpecialtyAssessmentsImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocument, PatientAssessmentVo patientAssessment) throws StaleObjectException
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("User assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = PatientAssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);
    factory.save(domainObject);

    return true;
}
项目:openMAXIMS    文件:PrintReportNoteDialogImpl.java   
/**
* savePatientDocument
*/
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralWizardVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralWizardVoAssembler.extractCatsReferral(factory, catReferral);
    if (catReferral != null) 
        doCatsReferral.getReferralDocuments().add(doc);                     

    factory.save(doCatsReferral);
}
项目:openMAXIMS    文件:DocumentWorklistImpl.java   
public void deletePatientDocument(PatientDocumentVo patDoc) throws ForeignKeyViolationException, StaleObjectException
{

    PatientDocument patDO = PatientDocumentVoAssembler.extractPatientDocument(getDomainFactory(), patDoc);
    if (patDO == null )
        throw new StaleObjectException(patDO);

    long count  = getDomainFactory().countWithHQL("select count(patDoc.id) " +
            "from PatientDocument as patDoc where " +
            "(patDoc.id = :patDocId and patDoc.version=:patVersion)"
            ,new String[]{"patDocId","patVersion"},
            new Object[]{patDoc.getID_PatientDocument(),patDoc.getVersion_PatientDocument()});

    if (count == 0)
        throw new StaleObjectException(patDO);

    //getDomainFactory().delete(patDO);
    patDO.setIsRIE(true);//WDEV-15417
    getDomainFactory().save(patDO);//WDEV-15417
}
项目:openMAXIMS    文件:DocumentWorklistImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    if (doc == null)
        throw new StaleObjectException(doc);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:openMAXIMS    文件:DnaBatchUpdateImpl.java   
@SuppressWarnings("unchecked")
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralVoAssembler.extractCatsReferral(factory, catReferral);
        doCatsReferral.getReferralDocuments().add(doc); 

    doCatsReferral.setHasDocuments(Boolean.TRUE);

    //wdev-8288
    doCatsReferral.setHasDNAApptsForReview(Boolean.TRUE);

    factory.save(doCatsReferral);
}
项目:openMAXIMS    文件:PatientSpecialtyAssessmentsImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocument, PatientAssessmentVo patientAssessment) throws StaleObjectException
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("User assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = PatientAssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);
    factory.save(domainObject);

    return true;
}
项目:openMAXIMS    文件:PrintReportNoteDialogImpl.java   
/**
* savePatientDocument
*/
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.RefMan.vo.CatsReferralWizardVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralWizardVoAssembler.extractCatsReferral(factory, catReferral);
    if (catReferral != null) 
        doCatsReferral.getReferralDocuments().add(doc);                     

    factory.save(doCatsReferral);
}
项目:openmaxims-linux    文件:DocumentWorklistImpl.java   
public void deletePatientDocument(PatientDocumentVo patDoc) throws ForeignKeyViolationException, StaleObjectException
{

    PatientDocument patDO = PatientDocumentVoAssembler.extractPatientDocument(getDomainFactory(), patDoc);
    if (patDO == null )
        throw new StaleObjectException(patDO);

    long count  = getDomainFactory().countWithHQL("select count(patDoc.id) " +
            "from PatientDocument as patDoc where " +
            "(patDoc.id = :patDocId and patDoc.version=:patVersion)"
            ,new String[]{"patDocId","patVersion"},
            new Object[]{patDoc.getID_PatientDocument(),patDoc.getVersion_PatientDocument()});

    if (count == 0)
        throw new StaleObjectException(patDO);

    //getDomainFactory().delete(patDO);
    patDO.setIsRIE(true);//WDEV-15417
    getDomainFactory().save(patDO);//WDEV-15417
}
项目:openmaxims-linux    文件:DocumentWorklistImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    if (doc == null)
        throw new StaleObjectException(doc);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:openmaxims-linux    文件:DnaBatchUpdateImpl.java   
@SuppressWarnings("unchecked")
public void savePatientDocument(ims.core.vo.PatientDocumentVo document, ims.careuk.vo.CatsReferralVo catReferral) throws ims.domain.exceptions.StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);              

    CatsReferral doCatsReferral = CatsReferralVoAssembler.extractCatsReferral(factory, catReferral);
        doCatsReferral.getReferralDocuments().add(doc); 

    doCatsReferral.setHasDocuments(Boolean.TRUE);

    //wdev-8288
    doCatsReferral.setHasDNAApptsForReview(Boolean.TRUE);

    factory.save(doCatsReferral);
}
项目:AvoinApotti    文件:ClinicLetterBatchCreateImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException 
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:AvoinApotti    文件:PatientDocumentEditImpl.java   
public PatientDocumentVo refreshPatDoc(PatientDocumentVo patDoc)
{
    DomainObject domainObject = getDomainFactory().getDomainObject(PatientDocument.class, patDoc.getID_PatientDocument());
    if (domainObject.getVersion()==patDoc.getBoVersion())
        return patDoc;
    return PatientDocumentVoAssembler.create((PatientDocument) domainObject);
}
项目:AvoinApotti    文件:PatientCorrespondenceTemplatesImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException 
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:AvoinApotti    文件:DocumentWorklistImpl.java   
public PatientDocumentVo getPatientDocument(PatientDocumentRefVo documentID) throws StaleObjectException
{
    if (documentID == null || !documentID.getID_PatientDocumentIsNotNull())
        throw new DomainRuntimeException("Invalid patient document reference provided");

    DomainObject domO = getDomainFactory().getDomainObject(PatientDocument.class, documentID.getID_PatientDocument());
    if (domO == null)
        throw new StaleObjectException(domO);

    if(Boolean.TRUE.equals(domO.getIsRIE()))//  WDEV-15417
        throw new StaleObjectException(domO);

    return PatientDocumentVoAssembler.create((PatientDocument) domO);
}
项目:AvoinApotti    文件:PrintReportImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocumentToSave) throws StaleObjectException 
{
    if (patientDocumentToSave == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocumentToSave.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocumentToSave);
    factory.save(domainPatientDocument);

    return true;
}
项目:AvoinApotti    文件:PatientDocumentsImpl.java   
public PatientDocumentVo getPatientDocument(PatientDocumentRefVo documentID) 
{
    if(documentID == null || !documentID.getID_PatientDocumentIsNotNull())
    {
        throw new CodingRuntimeException("Cannot get PatientDocument on null PatientDocumentId.");
    }

    return PatientDocumentVoAssembler.create((PatientDocument) getDomainFactory().getDomainObject(PatientDocument.class, documentID.getID_PatientDocument()));
}
项目:AvoinApotti    文件:PatientDocumentSearchImpl.java   
public PatientDocumentVo getPatientDocument(PatientDocumentRefVo documentID) 
{
    if(documentID == null || !documentID.getID_PatientDocumentIsNotNull())
    {
        throw new CodingRuntimeException("Cannot get PatientDocument on null PatientDocumentId.");
    }

    return PatientDocumentVoAssembler.create((PatientDocument) getDomainFactory().getDomainObject(PatientDocument.class, documentID.getID_PatientDocument()));
}
项目:AvoinApotti    文件:PatientDocumentSearchImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException 
{
    if(document == null)
        throw new CodingRuntimeException("Can not save a null PatientDocumentVo.");

    if(!document.isValidated())
        throw new CodingRuntimeException("PatientDocumentVo not validated");

    DomainFactory factory = getDomainFactory();
    PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
    factory.save(doc);  

    return PatientDocumentVoAssembler.create(doc);
}
项目:AvoinApotti    文件:MultiPrintDialogImpl.java   
public PatientDocumentErrorVoCollection savePatientDocuments(DocumentAndPatientWrapperVoCollection documents) 
{
    if(documents == null || documents.size() == 0)
        return null;

    PatientDocumentErrorVoCollection errors = new PatientDocumentErrorVoCollection();
    DomainFactory factory = getDomainFactory();

    for(int i=0; i<documents.size(); i++)
    {
        PatientDocumentVo document = documents.get(i).getDocument();

        if(document == null)
            continue;

        PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);

        try 
        {
            factory.save(doc);
        } 
        catch (StaleObjectException e) 
        {
            e.printStackTrace();
            errors.add(createError(documents.get(i), "Could not save Number of Copies."));
        }       
    }

    return errors.size() > 0 ? errors : null;
}
项目:AvoinApotti    文件:DynamicAssessmentsImpl.java   
/**
 * Function used to save a PatientDocument record and update PatientAssessment record (marked as have been printed)
 */
public Boolean savePatientDocument(PatientDocumentVo patientDocument, Patient_AssessmentVo patientAssessment) throws StaleObjectException
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("User assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = Patient_AssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);

    //wdev-15972
    if( domainObject != null && domainPatientDocument != null )
        domainObject.setAssociatedDocument(domainPatientDocument);

    //---------
    factory.save(domainObject);

    return true;
}
项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
public PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
    if(document == null) {
        throw new CodingRuntimeException("PatientDocumentVo is null");
    }
    if (!document.isValidated()) {
        throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);   
    factory.save(doPatientDocument);            
    return PatientDocumentVoAssembler.create(doPatientDocument);
}
项目:AvoinApotti    文件:DischargeSummaryScheduleSTHKFormImpl.java   
public void deletePatientDocument(PatientDocumentVo document) throws StaleObjectException, ForeignKeyViolationException
{
    if(document == null) {
        throw new CodingRuntimeException("PatientDocumentVo is null");
    }
    if (!document.isValidated()) {
        throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();
    PatientDocument doPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);   
    factory.delete(doPatientDocument);                  
}
项目:AvoinApotti    文件:DischargeSummaryConsultatntWardAndPacuImpl.java   
public void saveReport(PatientDocumentVo document, CatsReferralRefVo referral) throws StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();

    PatientDocument domDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);

    factory.save(domDocument);

    CatsReferral domCats = (CatsReferral) factory.getDomainObject(CatsReferral.class, referral.getID_CatsReferral());

    domCats.getReferralDocuments().add(domDocument);

    //wdev-8305
    if (document.getCategoryIsNotNull()
        && document.getCategory().equals(DocumentCategory.DISCHARGE_SUPPLEMENTARY))
        domCats.setRequiresDischargeRep(Boolean.FALSE);

    factory.save(domCats);

    PatientDocumentSaveVo vo = new PatientDocumentSaveVo();
    vo.setPatientDocumentVo(PatientDocumentVoAssembler.create(domDocument));
    vo.setCatsReferralWizardVo(CatsReferralWizardVoAssembler.create(domCats));
}
项目:AvoinApotti    文件:DischargeSummaryWardPacuImpl.java   
public void saveDocument(PatientDocumentVo document, CatsReferralRefVo referral, Boolean bIsCurrent) throws StaleObjectException
{
    if (document != null)
    {
        if (!document.isValidated())
            throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactory factory = getDomainFactory();

    PatientDocument domDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);

    factory.save(domDocument);

    CatsReferral domCats = (CatsReferral) factory.getDomainObject(CatsReferral.class, referral.getID_CatsReferral());

    //wdev-8305
    if (document.getCategoryIsNotNull()
        && document.getCategory().equals(DocumentCategory.DISCHARGE_SUPPLEMENTARY)
        && bIsCurrent != null
        && bIsCurrent)
        domCats.setRequiresDischargeRep(Boolean.FALSE);

    domCats.getReferralDocuments().add(domDocument);

    factory.save(domCats);

    PatientDocumentSaveVo vo = new PatientDocumentSaveVo();
    vo.setPatientDocumentVo(PatientDocumentVoAssembler.create(domDocument));
    vo.setCatsReferralWizardVo(CatsReferralWizardVoAssembler.create(domCats));
}
项目:AvoinApotti    文件:PrinterSelectionDialogImpl.java   
/**
    * savePatientDocument
    */
    public void savePatientDocument(PatientDocumentVo document, CatsReferralReportsVo catReferral, ReferralOutcomeVo voOutcome) throws StaleObjectException
    {
        if (document != null)
        {
            if (!document.isValidated())
                throw new DomainRuntimeException("PatientDocumentVo not validated");
        }

        DomainFactory factory = getDomainFactory();
        PatientDocument doc = PatientDocumentVoAssembler.extractPatientDocument(factory, document);
        factory.save(doc);              

        CatsReferral doCatsReferral = CatsReferralReportsVoAssembler.extractCatsReferral(factory, catReferral);
        if (catReferral != null) 
            doCatsReferral.getReferralDocuments().add(doc);                     

        factory.save(doCatsReferral);

        ReferralOutcome doRef = ReferralOutcomeVoAssembler.extractReferralOutcome(factory, voOutcome);
        if(doRef != null)   //wdev-12355
            factory.save(doRef);

//      PatientDocumentSaveVo vo = new PatientDocumentSaveVo();
//      vo.setPatientDocumentVo(PatientDocumentVoAssembler.create(doc));
//      vo.setCatsReferralWizardVo(CatsReferralWizardVoAssembler.create(doCatsReferral));       
    }
项目:AvoinApotti    文件:EDischargePatientAssessmentImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocument, PatientAssessmentVo patientAssessment) throws StaleObjectException 
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("Patient assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = PatientAssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);

    //wdev-15972
    if( domainObject != null && domainPatientDocument != null )
        domainObject.setAssociatedDocument(domainPatientDocument);
    //---------
    factory.save(domainObject);

    return true;
}
项目:AvoinApotti    文件:SurgicalOPNotesDiagramCCImpl.java   
public Boolean savePatientDocument(PatientDocumentVo patientDocument, PatientAssessmentVo patientAssessment) throws StaleObjectException
{
    if (patientDocument == null)
        throw new DomainRuntimeException("Invalid PatientDocument record");
    if (!patientDocument.isValidated())
        throw new DomainRuntimeException("PatientDocument record not validated");
    if(patientAssessment == null)
        throw new DomainRuntimeException("Invalid patient assessment");
    if(!patientAssessment.isValidated())
        throw new DomainRuntimeException("Patient assessment not validated");

    DomainFactory factory = getDomainFactory();

    // Save PatientDocumet record
    PatientDocument domainPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, patientDocument);
    factory.save(domainPatientDocument);

    // Save PatientAssessment record
    PatientAssessment domainObject = PatientAssessmentVoAssembler.extractPatientAssessment(factory, patientAssessment);
    //wdev-15972
    if( domainObject != null && domainPatientDocument != null )
        domainObject.setAssociatedDocument(domainPatientDocument);
    //---------
    factory.save(domainObject);

    return true;
}
项目:AvoinApotti    文件:EDischargePreViewComponentImpl.java   
public PatientDocumentVoCollection getPatientDocumentsForPatient(PatientRefVo voRef)    
{
    if(voRef == null ||
            voRef.getID_Patient() == null)
        throw new CodingRuntimeException("PatientRefVo is null or id not provided for getPatientDocumentsForPatient");  

    DomainFactory factory = getDomainFactory();
    List domainObjectList = factory.find("select pd from PatientDocument as pd left join pd.patient as patient where patient.id = :idPatient", new String[]{"idPatient"}, new Object[]{voRef.getID_Patient()});
    return PatientDocumentVoAssembler.createPatientDocumentVoCollectionFromPatientDocument(domainObjectList);                       
}
项目:openMAXIMS    文件:PatientClinicalNotesforEvolveIngestionJobImpl.java   
private PatientDocumentVo savePatientDocument(PatientDocumentVo document) throws StaleObjectException
{
            if(document == null) {
        throw new CodingRuntimeException("PatientDocumentVo is null");
    }
    if (!document.isValidated()) {
        throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactoryBridge factory = getDomainFactory();
    PatientDocument doPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);   
    factory.save(doPatientDocument);            
    return PatientDocumentVoAssembler.create(doPatientDocument);
}
项目:openMAXIMS    文件:EDDischargeDetailsJobImpl.java   
public void deletePatientDocument(PatientDocumentVo document) throws StaleObjectException, ForeignKeyViolationException
{
    if(document == null) {
        throw new CodingRuntimeException("PatientDocumentVo is null");
    }
    if (!document.isValidated()) {
        throw new DomainRuntimeException("PatientDocumentVo not validated");
    }

    DomainFactoryBridge factory = getDomainFactory();
    PatientDocument doPatientDocument = PatientDocumentVoAssembler.extractPatientDocument(factory, document);   
    factory.delete(doPatientDocument);                  
}