예제 #1
0
        /// <summary>
        /// Creates the patient document.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="patientDocumentType">Type of the patient document.</param>
        /// <param name="document">The document.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <returns>
        /// A PatientDocument.
        /// </returns>
        public PatientDocument CreatePatientDocument(
            Patient patient,
            PatientDocumentType patientDocumentType,
            byte[] document,
            string fileName )
        {
            var hash = _hashingUtility.ComputeHash ( document );

            var patientDocument = new PatientDocument(patient, patientDocumentType, document, fileName, hash);

            _patientDocumentRepository.MakePersistent ( patientDocument );

            return patientDocument;
        }
예제 #2
0
        /// <summary>
        /// Creates the patient document.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="patientDocumentType">Type of the patient document.</param>
        /// <param name="document">The document.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <returns>
        /// A PatientDocument.
        /// </returns>
        public PatientDocument CreatePatientDocument(
            Patient patient,
            PatientDocumentType patientDocumentType,
            byte[] document,
            string fileName)
        {
            var hash = _hashingUtility.ComputeHash(document);

            var patientDocument = new PatientDocument(patient, patientDocumentType, document, fileName, hash);

            _patientDocumentRepository.MakePersistent(patientDocument);

            return(patientDocument);
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientDocument"/> class.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="patientDocumentType">Type of the patient document.</param>
        /// <param name="document">The document.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="documentHashValue">The document hash value.</param>
        protected internal PatientDocument(
            Patient patient,
            PatientDocumentType patientDocumentType,
            byte[] document,
            string fileName,
            string documentHashValue)
        {
            Check.IsNotNull(patient, "Patient is required.");
            Check.IsNotNull(patientDocumentType, "Patient Document Type is required.");
            Check.IsNotNull(document, "Document contents are required.");
            Check.IsNotNullOrWhitespace(fileName, "Filename is required.");
            Check.IsNotNullOrWhitespace(documentHashValue, "Document Hash is required.");

            _patient             = patient;
            _patientDocumentType = patientDocumentType;
            _document            = document;
            _fileName            = fileName;
            _documentHashValue   = documentHashValue;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PatientDocument"/> class.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="patientDocumentType">Type of the patient document.</param>
        /// <param name="document">The document.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="documentHashValue">The document hash value.</param>
        protected internal PatientDocument(
            Patient patient,
            PatientDocumentType patientDocumentType,
            byte[] document,
            string fileName,
            string documentHashValue )
        {
            Check.IsNotNull ( patient, "Patient is required." );
            Check.IsNotNull ( patientDocumentType, "Patient Document Type is required." );
            Check.IsNotNull ( document, "Document contents are required." );
            Check.IsNotNullOrWhitespace ( fileName, "Filename is required." );
            Check.IsNotNullOrWhitespace ( documentHashValue, "Document Hash is required." );

            _patient = patient;
            _patientDocumentType = patientDocumentType;
            _document = document;
            _fileName = fileName;
            _documentHashValue = documentHashValue;
        }
예제 #5
0
 /// <summary>
 /// Revises the type of the patient document.
 /// </summary>
 /// <param name="patientDocumentType">Type of the patient document.</param>
 public virtual void RevisePatientDocumentType(PatientDocumentType patientDocumentType)
 {
     DomainRuleEngine.CreateRuleEngine <PatientDocument, PatientDocumentType>(this, () => RevisePatientDocumentType)
     .WithContext(patientDocumentType)
     .Execute(() => PatientDocumentType = patientDocumentType);
 }
예제 #6
0
 /// <summary>
 /// Revises the type of the patient document.
 /// </summary>
 /// <param name="patientDocumentType">Type of the patient document.</param>
 public virtual void RevisePatientDocumentType(PatientDocumentType patientDocumentType)
 {
     DomainRuleEngine.CreateRuleEngine<PatientDocument, PatientDocumentType>(this, () => RevisePatientDocumentType)
         .WithContext(patientDocumentType)
         .Execute ( () => PatientDocumentType = patientDocumentType );
 }