// Function to build observation fact
  public ObservationFactType getObservationFactType() {
    Date currentDate = new Date();
    ObservationFactType obType = new ObservationFactType();
    DTOFactory dtoFactory = new DTOFactory();
    obType.setEndDate(dtoFactory.getXMLGregorianCalendar(currentDate.getTime()));
    obType.setConceptCd("i2b2:60004");
    obType.setConfidenceNum(1d);
    obType.setEncounterIde(getEncounterIde());
    obType.setPatientIde(getPatientIde());
    obType.setSourcesystemCd("i2b2");
    obType.setTvalChar("tval");
    obType.setNvalNum(100.0);
    obType.setObservationBlob("BLOB");

    return obType;
  }
Beispiel #2
0
  /**
   * Function to build i2b2 message header
   *
   * @return MessageHeader object
   */
  public MessageHeaderType getMessageHeader() {
    MessageHeaderType messageHeader = new MessageHeaderType();

    messageHeader.setI2B2VersionCompatible(
        new BigDecimal(
            Messages.getString("OntologyRequestData.i2b2VersionCompatible"))); // $NON-NLS-1$

    ApplicationType appType = new ApplicationType();
    appType.setApplicationName(
        Messages.getString("OntologyRequestData.SendingApplicationName")); // $NON-NLS-1$
    appType.setApplicationVersion(
        Messages.getString("OntologyRequestData.SendingApplicationVersion")); // $NON-NLS-1$
    messageHeader.setSendingApplication(appType);

    FacilityType facility = new FacilityType();
    facility.setFacilityName(
        Messages.getString("OntologyRequestData.SendingFacilityName")); // $NON-NLS-1$
    messageHeader.setSendingFacility(facility);

    ApplicationType appType2 = new ApplicationType();
    appType2.setApplicationVersion(
        Messages.getString("OntologyRequestData.ReceivingApplicationVersion")); // $NON-NLS-1$
    appType2.setApplicationName(
        Messages.getString("OntologyRequestData.ReceivingApplicationName")); // $NON-NLS-1$
    messageHeader.setReceivingApplication(appType2);

    FacilityType facility2 = new FacilityType();
    facility2.setFacilityName(
        Messages.getString("OntologyRequestData.ReceivingFacilityName")); // $NON-NLS-1$
    messageHeader.setReceivingFacility(facility2);

    Date currentDate = new Date();
    DTOFactory factory = new DTOFactory();
    messageHeader.setDatetimeOfMessage(factory.getXMLGregorianCalendar(currentDate.getTime()));

    SecurityType secType = new SecurityType();
    secType.setDomain(UserInfoBean.getInstance().getUserDomain());
    secType.setUsername(UserInfoBean.getInstance().getUserName());
    PasswordType ptype = new PasswordType();
    ptype.setIsToken(UserInfoBean.getInstance().getUserPasswordIsToken());
    ptype.setTokenMsTimeout(UserInfoBean.getInstance().getUserPasswordTimeout());
    ptype.setValue(UserInfoBean.getInstance().getUserPassword());

    secType.setPassword(ptype);
    messageHeader.setSecurity(secType);

    MessageControlIdType mcIdType = new MessageControlIdType();
    mcIdType.setInstanceNum(0);
    mcIdType.setMessageNum(generateMessageId());
    messageHeader.setMessageControlId(mcIdType);

    ProcessingIdType proc = new ProcessingIdType();
    proc.setProcessingId(Messages.getString("OntologyRequestData.ProcessingId")); // $NON-NLS-1$
    proc.setProcessingMode(Messages.getString("OntologyRequestData.ProcessingMode")); // $NON-NLS-1$
    messageHeader.setProcessingId(proc);

    messageHeader.setAcceptAcknowledgementType(
        Messages.getString("OntologyRequestData.AcceptAcknowledgementType")); // $NON-NLS-1$
    messageHeader.setApplicationAcknowledgementType(
        Messages.getString("OntologyRequestData.ApplicationAcknowledgementType")); // $NON-NLS-1$
    messageHeader.setCountryCode(
        Messages.getString("OntologyRequestData.CountryCode")); // $NON-NLS-1$
    messageHeader.setProjectId(UserInfoBean.getInstance().getProjectId());
    return messageHeader;
  }