示例#1
0
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     GpToPractice obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("gp");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setGp(ims.core.resource.people.domain.objects.Gp.getGpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("practice");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPractice(
         ims.core.resource.place.domain.objects.Organisation.getOrganisationfromXML(
             fldEl, factory, domMap));
   }
   fldEl = el.element("isPrimaryPractice");
   if (fldEl != null) {
     obj.setIsPrimaryPractice(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("gpCode");
   if (fldEl != null) {
     obj.setGpCode(new String(fldEl.getTextTrim()));
   }
 }
示例#2
0
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

    auditStr.append("\r\n*gp* :");
    if (gp != null) {
      auditStr.append(toShortClassName(gp));

      auditStr.append(gp.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*practice* :");
    if (practice != null) {
      auditStr.append(toShortClassName(practice));

      auditStr.append(practice.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*isPrimaryPractice* :");
    auditStr.append(isPrimaryPractice);
    auditStr.append("; ");
    auditStr.append("\r\n*gpCode* :");
    auditStr.append(gpCode);
    auditStr.append("; ");
    return auditStr.toString();
  }
示例#3
0
  private String getTaxonomyCode(Organisation practice, TaxonomyType taxMap) {
    if (practice == null || taxMap == null) return null;

    if (practice.getCodeMappings() != null) {
      for (int j = 0; j < practice.getCodeMappings().size(); j++) {
        Object mapping = practice.getCodeMappings().get(j);

        if (mapping instanceof TaxonomyMap) {
          if (((TaxonomyMap) mapping).getTaxonomyName() != null
              && (taxMap.getID() == ((TaxonomyMap) mapping).getTaxonomyName().getId())) {
            return ((TaxonomyMap) mapping).getTaxonomyCode();
          }
        }
      }
    }

    return null;
  }
示例#4
0
 public static void fillFieldsfromXML(
     org.dom4j.Element el,
     ims.domain.DomainFactory factory,
     PatientGP obj,
     java.util.HashMap domMap)
     throws Exception {
   org.dom4j.Element fldEl;
   fldEl = el.element("lkp_provisiontype");
   if (fldEl != null) {
     fldEl = fldEl.element("lki");
     obj.setLkp_provisiontype(ims.domain.lookups.LookupInstance.fromXMLString(fldEl, factory));
   }
   fldEl = el.element("primaryCareIdentifier");
   if (fldEl != null) {
     obj.setPrimaryCareIdentifier(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("objectidentifier");
   if (fldEl != null) {
     obj.setObjectidentifier(new String(fldEl.getTextTrim()));
   }
   fldEl = el.element("beffdate");
   if (fldEl != null) {
     obj.setBeffdate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("beffdatecnf");
   if (fldEl != null) {
     obj.setBeffdatecnf(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("betdate");
   if (fldEl != null) {
     obj.setBetdate(
         new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").parse(fldEl.getTextTrim()));
   }
   fldEl = el.element("betdatecnf");
   if (fldEl != null) {
     obj.setBetdatecnf(new Boolean(fldEl.getTextTrim()));
   }
   fldEl = el.element("gp");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setGp(ims.core.resource.people.domain.objects.Gp.getGpfromXML(fldEl, factory, domMap));
   }
   fldEl = el.element("practice");
   if (fldEl != null) {
     fldEl = fldEl.element("class");
     obj.setPractice(
         ims.core.resource.place.domain.objects.Organisation.getOrganisationfromXML(
             fldEl, factory, domMap));
   }
 }
示例#5
0
  public String toAuditString() {
    StringBuffer auditStr = new StringBuffer();

    auditStr.append("\r\n*lkp_provisiontype* :");
    if (lkp_provisiontype != null) auditStr.append(lkp_provisiontype.getText());
    auditStr.append("; ");
    auditStr.append("\r\n*primaryCareIdentifier* :");
    auditStr.append(primaryCareIdentifier);
    auditStr.append("; ");
    auditStr.append("\r\n*objectidentifier* :");
    auditStr.append(objectidentifier);
    auditStr.append("; ");
    auditStr.append("\r\n*beffdate* :");
    auditStr.append(beffdate);
    auditStr.append("; ");
    auditStr.append("\r\n*beffdatecnf* :");
    auditStr.append(beffdatecnf);
    auditStr.append("; ");
    auditStr.append("\r\n*betdate* :");
    auditStr.append(betdate);
    auditStr.append("; ");
    auditStr.append("\r\n*betdatecnf* :");
    auditStr.append(betdatecnf);
    auditStr.append("; ");
    auditStr.append("\r\n*gp* :");
    if (gp != null) {
      auditStr.append(toShortClassName(gp));

      auditStr.append(gp.getId());
    }
    auditStr.append("; ");
    auditStr.append("\r\n*practice* :");
    if (practice != null) {
      auditStr.append(toShortClassName(practice));

      auditStr.append(practice.getId());
    }
    auditStr.append("; ");
    return auditStr.toString();
  }
示例#6
0
  // WDEV-23281
  private void processPracticeSDSLookup(PDSConfigurationVo conf) {
    if (practices == null || practices.size() == 0) return;

    createSystemLogEntry(
        SystemLogType.SDS,
        SystemLogLevel.INFORMATION,
        "Start Process of Practice Full SDS Job - Number of records to process = "
            + practices.size());

    Iterator<Organisation> it = practices.iterator();
    while (it.hasNext()) {

      Organisation practice = it.next();

      DomainFactoryBridge factory = getDomainFactory();

      if (practice == null) continue;

      String sdsOrgId = getTaxonomyCode(practice, TaxonomyType.ICAB);

      if (sdsOrgId == null || sdsOrgId.length() == 0) {
        sdsOrgId = getTaxonomyCode(practice, TaxonomyType.NAT_LOC_CODE);
      }

      if (sdsOrgId != null && sdsOrgId.length() > 0) {
        TotalPracticesNo++;

        SdsRequestHelper sdsHelper = new SdsRequestHelper(conf);

        Organisation updatedPractice = null;

        try {
          updatedPractice =
              sdsHelper.processPracticeSdsRequest(practice, conf.getSDSHost(), conf.getSDSPort());

          if (updatedPractice != null && practice != null) {
            practice.setName(updatedPractice.getName());
            practice.setUpperName(updatedPractice.getUpperName());
            practice.setAddress(updatedPractice.getAddress());
            practice.setIsActive(updatedPractice.isIsActive());
            practice.setPctCode(updatedPractice.getPctCode());

            try {
              factory.save(practice);
              if (TotalPracticesNo % 100 == 0) {
                createSystemLogEntry(
                    SystemLogType.SDS,
                    SystemLogLevel.INFORMATION,
                    "Commit tranaction Practice Full SDS Job - Number of records processed = "
                        + TotalPracticesNo);
                factory.commitTransaction();
              }
            } catch (Exception e) {
              // trace("Error saving SDS request for Practice '" + practice.getName()  + "': " +
              // e.getMessage());
              if (practice != null)
                createSystemLogEntry(
                    SystemLogType.SDS,
                    SystemLogLevel.ERROR,
                    "Error saving SDS request for Practice '"
                        + practice.getName()
                        + "': "
                        + e.getMessage());
              FailedNoSavingPractices++;
              continue;
            }
          }

        } catch (Exception e) {
          // trace("Error processing SDS request for Practice '" + practice.getName()  + "': " +
          // e.getMessage());
          if (practice != null)
            createSystemLogEntry(
                SystemLogType.SDS,
                SystemLogLevel.ERROR,
                "Error processing SDS request for Practice '"
                    + practice.getName()
                    + "': "
                    + e.getMessage());
          FailedNoProcessingPractices++;
          continue;
        }

        //				if(updatedPractice != null)
        //				{
        //					if(updatedPractices == null)
        //					{
        //						updatedPractices = new HashSet<Organisation>();
        //					}
        //
        //					updatedPractices.add(updatedPractice);
        //				}
      }
    }
  }