opensource-emr / hospital-management-emr

A complete open source for electronic healthcare record management in Hospitals, Clinics and Pharmacy.
https://opensource-emr.github.io/hospital-management-emr/
MIT License
255 stars 176 forks source link

Lot of error, Is the application/code and the database bak created at the same point in the development? #82

Closed Vijay-Nirmal closed 7 months ago

Vijay-Nirmal commented 7 months ago

I am getting lots of errors when working in the app. Below I have provide some of the sample error but there are lot more error like this when doing simple tasks like adding (Requisition) a lap test.

SqlException: Cannot insert the value NULL into column 'LabTypeName', table 'DEV_DanpheEMR.dbo.LAB_TestRequisition';

SqlException: Cannot insert the value NULL into column 'IsFileUploaded', table 'DEV_DanpheEMR.dbo.LAB_TestRequisition'; column does not allow nulls. INSERT fails.

Error converting value {null} to type 'System.DateTime'. Path '[0].OrderDateTime', line 1, position 333.

SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_LAB_TestRequisition_BIL_TXN_BillingTransactionItems". The conflict occurred in database "DEV_DanpheEMR", table "dbo.BIL_TXN_BillingTransactionItems", column 'BillingTransactionItemId'.

Here are my questions,

  1. Is the application/code and the database bak created at the same point in the development?
  2. Am I missing something? (I am not sure what detail you need to answer this question, pls ask for any details)

One of the reasons I have this question is because there as many mismatches between ORM and database schema. For example, IsFileUploaded is a nullable bool in ORM but in the database, it's not a nullable field. I have noticed IsFileUploaded column in changes from nullable to non nullable in v3.0 (By checking EMR_V3.0_Master Incremental.sql file)

https://github.com/opensource-emr/hospital-management-emr/blob/251e060d74ed38db2e386c70ccf595816b29518c/Code/Components/DanpheEMR.ServerModel/LabModels/LabRequisitionModel.cs#L82

Details: Version used: 3.2 Deploying method: Using zip files from git release and followed the setup youtube vide Hosting method: IIS

opensource-emr commented 7 months ago

Hi Vijay, This project is DB first so the direct connection between code and DB is not present. Many of the errors of NULLS due to some master DB data not present. Can you write down the steps on which screen you are getting it we will check it.

Yes the code and build are in synch. In couple of days we will be uploading a new code base and build you can check the same as well. Thanks

Vijay-Nirmal commented 7 months ago

On press of "Sign" in http://domain:port/Home/Index#/Doctors/PatientOverviewMain/Orders/OrderRequisition page I am getting this issue. I am getting uses on other pages/flows as well.

Flow:

  1. Check in an existing patient or new patient from Appointment/New Visit module (I used "Dr. Admin Doctor" as doctor)
  2. Go to Doctor/OutPatientDoctor/NewPatient Module
  3. Select of "Preview" icon in "Actions" column of the patient
  4. Press "+Add" button in "Labs" section
  5. Add some labs in the "New Orders" section
  6. Click "Proceed" in "Selected Orders" section
  7. Click "Sign"
  8. You will get this error now if you are running in Debug mode in Visual Studio
exsammy commented 7 months ago

Please use the updated version. Errors are minimal there. The one with keneya db

opensource-emr commented 7 months ago

these bugs are fixed in the recent version please check it.