Package uk.nhs.interoperability.payloads.exceptions

Examples of uk.nhs.interoperability.payloads.exceptions.MissingMandatoryFieldException.addMissingField()


    // Null checks for mandatory fields
    if (fields.getCustodianOrganisationODSID() == null) {
      missingFields.addMissingField("CustodianOrganisationODSID", "The ODS ID of the custodian organisation must be provided");
    }
    if (fields.getCustodianOrganisation() == null) {
      missingFields.addMissingField("CustodianOrganisation", "The name of the custodian organisation must be provided");
    }
    if (missingFields.hasEntries()) {
      throw missingFields;
    }
   
View Full Code Here


 
  public static Recipient createRecipient(DocumentRecipient recipient) throws MissingMandatoryFieldException {
    MissingMandatoryFieldException missingFields = new MissingMandatoryFieldException();
    // Null checks for mandatory fields
    if (recipient.getRecipientName() == null) {
      missingFields.addMissingField("recipientName", "The name of the recipient must be provided");
    }
    if (recipient.getRecipientODSCode() == null) {
      missingFields.addMissingField("recipientODSCode", "The ODS Code for the organisation of the recipient must be provided");
    }
    if (recipient.getRecipientOrganisationName() == null) {
View Full Code Here

    // Null checks for mandatory fields
    if (recipient.getRecipientName() == null) {
      missingFields.addMissingField("recipientName", "The name of the recipient must be provided");
    }
    if (recipient.getRecipientODSCode() == null) {
      missingFields.addMissingField("recipientODSCode", "The ODS Code for the organisation of the recipient must be provided");
    }
    if (recipient.getRecipientOrganisationName() == null) {
      missingFields.addMissingField("recipientOrganisationName", "The organisation name for the recipient must be provided");
    }
    if (missingFields.hasEntries()) {
View Full Code Here

    }
    if (recipient.getRecipientODSCode() == null) {
      missingFields.addMissingField("recipientODSCode", "The ODS Code for the organisation of the recipient must be provided");
    }
    if (recipient.getRecipientOrganisationName() == null) {
      missingFields.addMissingField("recipientOrganisationName", "The organisation name for the recipient must be provided");
    }
    if (missingFields.hasEntries()) {
      throw missingFields;
    }
    RecipientPersonUniversal template = new RecipientPersonUniversal();
View Full Code Here

   
    // Title
    if (commonFields.getDocumentTitle() != null) {
      template.setDocumentTitle(commonFields.getDocumentTitle());
    } else {
      missingFields.addMissingField("documentTitle", "The document title must be provided");
    }
   
    // Document Type
    if (commonFields.getDocumentType() != null) {
      template.setDocumentType(commonFields.getDocumentType());
View Full Code Here

   
    // Document Type
    if (commonFields.getDocumentType() != null) {
      template.setDocumentType(commonFields.getDocumentType());
    } else {
      missingFields.addMissingField("documentType", "The document type must be provided");
    }
   
    // If no record effective date/time specified, assume the current date/time
    if (commonFields.getDocumentEffectiveTime() == null) {
      template.setEffectiveTime(currentDateTime);
View Full Code Here

   
    // Recipients
   
    // Having at least one recipient is mandatory
    if (commonFields.getRecipients()==null) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else if (commonFields.getRecipients().size()==0) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else {
      // Primary Recipients
      for (DocumentRecipient recipient : commonFields.getRecipients()) {
View Full Code Here

   
    // Having at least one recipient is mandatory
    if (commonFields.getRecipients()==null) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else if (commonFields.getRecipients().size()==0) {
      missingFields.addMissingField("recipients", "At least one recipient must be provided");
    } else {
      // Primary Recipients
      for (DocumentRecipient recipient : commonFields.getRecipients()) {
        try {
          Recipient r = createRecipient(recipient);
View Full Code Here

    }
   
    // Authenticator
    if (commonFields.getAuthenticatorName() != null) {
      if (commonFields.getAuthenticatedTime() == null) {
        missingFields.addMissingField("authenticatedTime", "The time the document was authenticated must be provided");
      } else {
        template.setTimeAuthenticated(commonFields.getAuthenticatedTime());
      }
      try {
        template.setAuthenticator(createAuthenticator(commonFields));
View Full Code Here

   
    // Participants
    if (commonFields.getParticipants() != null) {
      for (NonCodedCDAParticipant participant : commonFields.getParticipants()) {
        if (participant.getParticipantType() == null) {
          missingFields.addMissingField("participantType", "The participant type must be provided");
        }
        try {
          Participant p = createParticipant(participant);
          template.addParticipant((
                new DocumentParticipant()
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.