Пример #1
0
        public List <Record> GetRecords(string patientNRIC, long noteID)
        {
            if (AccountBLL.IsTherapist())
            {
                List <Record>  records = recordDAL.RetrieveRecords(noteID, patientNRIC, AccountBLL.GetNRIC());
                Entity.Patient patient = new TherapistBLL().GetPatient(patientNRIC);

                List <Record> result = new List <Record>();
                foreach (Record record in records)
                {
                    if (!patient.hasPermissionsApproved(record))
                    {
                        Record newRecord = new Record();
                        newRecord.id     = record.id;
                        newRecord.title  = record.title;
                        newRecord.type   = record.type;
                        newRecord.status = record.status;
                        newRecord.recordPermissionStatus = record.recordPermissionStatus;
                        result.Add(newRecord);
                    }
                    else
                    {
                        record.permited = true;
                        result.Add(record);
                    }
                }

                logRecordBLL.LogEvent(AccountBLL.GetNRIC(), "View Records of Note", "Action on: " + patientNRIC + " , Note ID: " + noteID + ".");
                return(result);
            }

            return(null);
        }
Пример #2
0
        public void AddRecordDiagnosis(string patientNRIC, long recordID, string code)
        {
            if (AccountBLL.IsTherapist())
            {
                Record         record  = recordDAL.RetrieveRecord(recordID, AccountBLL.GetNRIC());
                Entity.Patient patient = new TherapistBLL().GetPatient(record.patientNRIC);

                if (record.patientNRIC.Equals(patientNRIC) && patient.hasPermissionsApproved(record))
                {
                    logRecordBLL.LogEvent(AccountBLL.GetNRIC(), "Insert Record Diagnoses", "Action on: " + patientNRIC + ", Record ID: " + recordID + ", Diagnosis Code: " + code + ".");

                    recordDAL.InsertRecordDiagnosis(AccountBLL.GetNRIC(), recordID, code);
                }
            }
        }
Пример #3
0
        public List <RecordDiagnosis> GetRecordDiagnoses(long recordID)
        {
            if (AccountBLL.IsPatient())
            {
                return(recordDAL.RetrieveRecordDiagnoses(recordID, AccountBLL.GetNRIC()));
            }
            else if (AccountBLL.IsTherapist())
            {
                Record         record  = recordDAL.RetrieveRecord(recordID, AccountBLL.GetNRIC());
                Entity.Patient patient = new TherapistBLL().GetPatient(record.patientNRIC);

                if (patient.hasPermissionsApproved(record))
                {
                    List <RecordDiagnosis> result = recordDAL.RetrieveRecordDiagnoses(recordID, record.patientNRIC, AccountBLL.GetNRIC());
                    logRecordBLL.LogEvent(AccountBLL.GetNRIC(), "View Record Diagnoses", "Record ID: " + recordID + ".");
                    return(result);
                }
            }

            return(null);
        }
Пример #4
0
        public Record GetRecord(long recordID)
        {
            if (AccountBLL.IsPatient())
            {
                return(recordDAL.RetrieveRecord(AccountBLL.GetNRIC(), recordID));
            }
            else if (AccountBLL.IsTherapist())
            {
                Record         record  = recordDAL.RetrieveRecord(recordID, AccountBLL.GetNRIC());
                Entity.Patient patient = new TherapistBLL().GetPatient(record.patientNRIC);

                if (patient.hasPermissionsApproved(record))
                {
                    record.permited = true;

                    logRecordBLL.LogEvent(AccountBLL.GetNRIC(), "View Record", "Record ID: " + recordID + ".");

                    return(record);
                }
            }

            return(null);
        }