Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1269 commits
Select commit Hold shift + click to select a range
ed0c4c0
🐛 fix(dde_ids_sync): remove obsolete method for updating existing DDE…
petroskayange Sep 2, 2025
2ecd72b
✨ feat(patients): integrate couchdb sync for patient records
petroskayange Sep 3, 2025
9c0a4c7
♻️ refactor(patients): fetch patient records from CouchDB
petroskayange Sep 6, 2025
a665f63
♻️ refactor(sync): simplify BatchPatientSyncJob and improve performance
petroskayange Sep 6, 2025
b77e097
✨ feat(couchdb): implement couchdb patient service
petroskayange Sep 6, 2025
778756e
♻️ refactor(batch_sync): namespace BatchPatientSyncJob under Sync module
petroskayange Sep 7, 2025
c7a116b
♻️ refactor(patient): replace patient sync service with batch sync job
petroskayange Sep 8, 2025
78406dc
✨ feat(visit): integrate CouchDB synchronization for visits and stages
petroskayange Sep 8, 2025
d903a12
✨ feat(couchdb): implement incremental patient sync by date changed
petroskayange Sep 8, 2025
927bc25
♻️ refactor(sync): remove patient sync and processed data
petroskayange Sep 8, 2025
08347b2
Merge branch 'chore/find_patients_pagination' of github.com:HISMalawi…
petroskayange Sep 9, 2025
37782ff
✨ feat(sidekiq): add queue for offline data sync
petroskayange Sep 12, 2025
0247129
🐛 fix(sync): add skipped count to progress logging
petroskayange Sep 12, 2025
fb8c667
✨ feat(sync): add skipped count to sync completion log
petroskayange Sep 17, 2025
0f4a232
✨ feat(global_property): change property column type to string with u…
petroskayange Sep 20, 2025
e5d5d39
🐛 fix(global_properties): handle record invalid errors in create
petroskayange Sep 20, 2025
e06bb7e
🐛 fix(global_properties): fix global property create/update logic
petroskayange Sep 20, 2025
08ca9d8
♻️ refactor(global_properties): simplify create/update actions
petroskayange Sep 20, 2025
827328a
🐛 fix(global_property): remove primary key definition
petroskayange Sep 20, 2025
3f42727
Merge pull request #808 from HISMalawi/ChangePropertyColumnTypeInGlob…
ShammyIII Sep 23, 2025
977f726
✨ feat(patient): add get patient list endpoint
petroskayange Sep 23, 2025
4d3a18e
🐛 fix(global_property): retrieve site prefix by location
petroskayange Sep 30, 2025
2337879
Merge pull request #809 from HISMalawi/global_property
dominickasanga Sep 30, 2025
6b2aece
✨ feat(lab): implement HTS referral orders
petroskayange Oct 7, 2025
1c1eff0
Merge pull request #810 from HISMalawi/hts
ShammyIII Oct 7, 2025
28ac39b
modified: app/services/build_patient_record_service.rb
dominickasanga Oct 7, 2025
7895aee
modified: app/services/build_patient_record_service.rb
dominickasanga Oct 7, 2025
3cc41a7
modified: app/services/immunization_service/vaccine_schedule_servic…
dominickasanga Oct 8, 2025
e2571b5
modified: app/services/save_patient_record_service.rb
dominickasanga Oct 8, 2025
34cdcac
Merge pull request #812 from HISMalawi/EIR_issues
ShammyIII Oct 8, 2025
e65518d
📦 build(deps): update gems in vendor/cache
petroskayange Oct 8, 2025
9829271
🐛 fix(dde): allow nil location_id for allocate_npids
petroskayange Oct 11, 2025
eeeafe8
✨ feat(couchdb): process all unprocessed documents on startup
petroskayange Oct 11, 2025
ba46d26
🐛 fix(dde_ids_sync): filter unassigned dde ids by status
petroskayange Oct 11, 2025
bfb5b05
✨ feat(schedule): add dde ids sync job
petroskayange Oct 12, 2025
c92c8c5
🐛 fix(sidekiq): add namespace to redis connection
petroskayange Oct 12, 2025
91f69b9
✨ feat(sidekiq): configure sidekiq web UI
petroskayange Oct 12, 2025
d8f2027
🔧 chore(sidekiq): configure sidekiq redis and routes
petroskayange Oct 12, 2025
d60a9c3
🐛 fix(sidekiq): correct redis database number
petroskayange Oct 12, 2025
21afba9
✨ feat(couchdb): add graceful shutdown to couchdb listeners
petroskayange Oct 12, 2025
ab5e3b3
🐛 fix(couchdb): improve couchdb listener stability and shutdown
petroskayange Oct 12, 2025
d36dac2
♻️ refactor(couchdb): improve couchdb listener management and shutdown
petroskayange Oct 12, 2025
be87b3c
✨ feat(couchdb): implement couchdb listeners
petroskayange Oct 12, 2025
533ebbf
♻️ refactor(couchdb): move couchdb listener to rake task
petroskayange Oct 12, 2025
b6e2b45
✨ feat(couchdb): implement robust couchdb changes listener
petroskayange Oct 12, 2025
1141611
✨ feat(couchdb): run listener in background thread
petroskayange Oct 12, 2025
f7c5543
♻️ refactor(couchdb): improve couchdb listener rake tasks
petroskayange Oct 12, 2025
42f1399
♻️ refactor(couchdb): simplify rake task to use class method
petroskayange Oct 12, 2025
41a04ac
♻️ refactor(couchdb): simplify couchdb listener and improve error han…
petroskayange Oct 12, 2025
faaf8a7
✨ feat(couchdb): add rake task to start listener for specific database
petroskayange Oct 12, 2025
07403bf
🐛 fix(couchdb): process unprocessed docs on startup
petroskayange Oct 12, 2025
22bc32e
🐛 fix(lab_test_orders): fix hts referral orders endpoint
petroskayange Oct 13, 2025
beeb509
⚡️ perf(lab): improve hts referral orders query performance
petroskayange Oct 15, 2025
c67798b
fix hiv tests
petroskayange Oct 15, 2025
959ea5a
🐛 fix(lab): fix lab results saving logic
petroskayange Oct 16, 2025
2ccda45
🐛 fix(lab): fix lab results saving and referral creation
petroskayange Oct 16, 2025
f684d86
📦 build(gems): update gems in gemfile and vendor cache
petroskayange Oct 18, 2025
9651961
new gems
petroskayange Oct 18, 2025
9160fc1
new gems
petroskayange Oct 18, 2025
0459127
new gems
petroskayange Oct 18, 2025
3727d8f
new gems
petroskayange Oct 18, 2025
2953ce0
new gems
petroskayange Oct 18, 2025
c717439
new gems
petroskayange Oct 18, 2025
5729dc0
new gems
petroskayange Oct 18, 2025
5e95d0a
new gems
petroskayange Oct 18, 2025
5e4c76e
🐛 fix(lab_data_manager): prevent duplicate lab results
petroskayange Oct 20, 2025
cb804b5
fix gems
petroskayange Oct 20, 2025
49b7dbf
fix gems
petroskayange Oct 20, 2025
6f66f8c
fix gems
petroskayange Oct 20, 2025
77e5660
fix gems
petroskayange Oct 20, 2025
1d2016d
fix gems
petroskayange Oct 20, 2025
a136589
♻️ refactor(encounter): improve encounter data loading
petroskayange Oct 23, 2025
7d23821
Merge pull request #814 from HISMalawi/referral
dominickasanga Oct 23, 2025
ea9765c
🔧 chore(deps): add .keep file to vendor directory
petroskayange Oct 23, 2025
a7fbe71
📦 build(gems): update gems in vendor/cache
petroskayange Oct 23, 2025
0636c25
Merge pull request #813 from HISMalawi/hts
ShammyIII Oct 23, 2025
7ab6f77
✨ feat(lab_test_orders): filter lab test orders by result
petroskayange Oct 25, 2025
84a19dc
Merge pull request #815 from HISMalawi/hts
ShammyIII Oct 28, 2025
7862857
Merge branch 'chore/find_patients_pagination' of github.com:HISMalawi…
petroskayange Nov 2, 2025
b5c266a
🐛 fix(observation): permit observation parameters
petroskayange Nov 2, 2025
fef2652
Fix ANC report ArgumentError - update find_report signatures
KytonThaundi Nov 5, 2025
514d345
Merge pull request #816 from HISMalawi/fix/anc-report-argument-error
KytonThaundi Nov 5, 2025
081a754
new file: lib/tasks/remove_duplicate_drug_orders.rake
dominickasanga Nov 5, 2025
43b5fd4
modified: lib/tasks/remove_duplicate_drug_orders.rake
dominickasanga Nov 5, 2025
831e05e
🐛 fix(couchdb): use existing ID for couchdb _id
petroskayange Nov 5, 2025
919ffed
Merge pull request #818 from HISMalawi/fix_duplicate_prescriptions
ShammyIII Nov 6, 2025
504d3da
✨ feat(couchdb): enhance CouchDB patient service
petroskayange Nov 7, 2025
6d1c443
✨ feat(visits): create stage during visit creation
petroskayange Nov 7, 2025
2a19c18
🐛 fix(visits): fix stage creation logic
petroskayange Nov 12, 2025
72a2058
✨ feat(hts): implement hts dashboard statistics
petroskayange Nov 12, 2025
c3952c8
✨ feat(visits): create encounter when creating a visit
petroskayange Nov 15, 2025
ebaea7b
🐛 fix(visits): remove provider_id from allowed fields
petroskayange Nov 16, 2025
56d2061
Adding AHD encounter, neonatal program and visit encounter in meta data
petroskayange Nov 17, 2025
4e76dcc
editing neonatal program
petroskayange Nov 17, 2025
38b7e9a
Merge pull request #807 from HISMalawi/pouchDB
ShammyIII Nov 17, 2025
8460240
scope models to a location
brian-mw Nov 7, 2025
c0e3009
update location_id field to have default location
brian-mw Nov 13, 2025
23d9546
✨ feat(patient): implement dispensation data saving
petroskayange Nov 30, 2025
f7869b6
Revert "scope models to a location"
petroskayange Nov 30, 2025
f17b191
Reapply "scope models to a location"
petroskayange Nov 30, 2025
de1b3f9
Revert "scope models to a location"
petroskayange Nov 30, 2025
2e3fa0e
Merge branch 'chore/find_patients_pagination' of github.com:HISMalawi…
petroskayange Nov 30, 2025
2e9aec8
Merge pull request #828 from HISMalawi/revert_facility_changes
ShammyIII Nov 30, 2025
29a1c1a
🐛 fix(patient_record): ensure boolean return for medication order saver
petroskayange Nov 30, 2025
144314f
Merge pull request #827 from HISMalawi/___offline_fix
ShammyIII Dec 1, 2025
94ab9fc
🐛 fix(couchdb): fetch patient by identifier instead of patient_id
petroskayange Dec 2, 2025
3728856
Merge pull request #831 from HISMalawi/___offline_fix
dominickasanga Dec 2, 2025
e1b0e0d
✨ feat(stock): enhance stock sync job with adjustments
petroskayange Dec 4, 2025
098ff8f
📝 docs(sync): add rake task documentation
petroskayange Dec 4, 2025
b02c7dc
🐛 fix(visits): fix visits endpoint to filter visits correctly
petroskayange Dec 4, 2025
36dedc2
Merge pull request #832 from HISMalawi/___offline_fix
ShammyIII Dec 4, 2025
bc0b7a4
Implement feature X to enhance user experience and optimize performance
petroskayange Dec 9, 2025
acf57b7
🐛 fix(hts_reports): update daily_stats to accept filters for improved…
petroskayange Dec 10, 2025
b380cd2
🐛 fix(stock): filter stock items by expiry date and quantity; update …
petroskayange Dec 11, 2025
e9d6c87
Merge pull request #833 from HISMalawi/___offline_fix
ShammyIII Dec 12, 2025
e04ceb2
improve grouping of observations
petroskayange Dec 13, 2025
d2190ea
adding saving of observations when saving lab order
petroskayange Dec 14, 2025
5bcc5d3
improve building of all observations
petroskayange Dec 14, 2025
6676883
adding location when creating dispensation
petroskayange Dec 14, 2025
59af2d2
Merge pull request #841 from HISMalawi/___offline_fix
ShammyIII Dec 14, 2025
9c1e2d0
using uuid when syncing concepts
petroskayange Dec 17, 2025
92f517d
adding neonatal encounters
petroskayange Dec 17, 2025
dd4d92c
Merge pull request #844 from HISMalawi/___offline_fix
ShammyIII Dec 17, 2025
fcad2ee
Adding creation of concepts script and neonatal concepts
petroskayange Dec 17, 2025
ce6fb11
making visit and stage working without couchdb
petroskayange Dec 18, 2025
f41069e
removing files that use mongo
petroskayange Dec 18, 2025
10fb843
Merge pull request #845 from HISMalawi/create_concept_script
KellsWorks Dec 18, 2025
ea2e5d8
adding routes to get neonatal stats
petroskayange Dec 18, 2025
a1c3523
adding neonatal controller
petroskayange Dec 18, 2025
cf1da60
adding neonatal engine
petroskayange Dec 18, 2025
c0547d5
adding neonatal concepts
petroskayange Dec 18, 2025
df6fd3a
adding neonatal concepts
petroskayange Dec 18, 2025
3c5b269
adding neonatal concept
petroskayange Dec 18, 2025
0acb662
Merge pull request #846 from HISMalawi/neonatal_dashboard
KellsWorks Dec 18, 2025
4601a32
remove unused patient record services and related modules
petroskayange Dec 20, 2025
362bbe7
refactor: remove unused observation and patient record services
petroskayange Dec 20, 2025
a9848b1
refactor: optimize batch patient sync job for performance and memory …
petroskayange Dec 22, 2025
cb9b44f
feat: implement patient retrieval method and update registration coun…
petroskayange Dec 23, 2025
f1bc9c2
refactor: streamline NCD dashboard data retrieval and calculations
petroskayange Dec 24, 2025
c7ffb32
refactor: enhance data structure for gender and diagnosis reporting i…
petroskayange Dec 24, 2025
6e4d490
refactor: update patient retrieval logic to use observations for quar…
petroskayange Dec 24, 2025
623aa0d
feat: implement NcdActivePatientService for retrieving active patient…
petroskayange Dec 25, 2025
0481751
refactor: remove unused printer configurations and NCD active clients…
petroskayange Dec 26, 2025
93c2cb3
refactor: clean up NCD active patients logic and remove unused config…
petroskayange Dec 26, 2025
c58ce29
Merge pull request #848 from HISMalawi/improve_offline
dominickasanga Dec 26, 2025
266ee53
Merge pull request #849 from HISMalawi/fix_couchdb_mongo
dominickasanga Dec 29, 2025
6982e81
adding ANC concepts
petroskayange Jan 1, 2026
e2cb5d9
Merge pull request #850 from HISMalawi/add_ANC_concepts
ShammyIII Jan 1, 2026
568a06c
adding missing concept and TDV drug
petroskayange Jan 4, 2026
ed21a62
fix: added missing add neonate encounters
KellsWorks Dec 19, 2025
2de5b8c
refactor: deatetime in saved encounters
KellsWorks Jan 5, 2026
7821d02
adding voiding of encounters
petroskayange Jan 6, 2026
2ae8f65
improving voiding offline
petroskayange Jan 6, 2026
828073f
Adding new ANC concepts
petroskayange Jan 6, 2026
fa95ebf
Merge pull request #851 from HISMalawi/add_ANC_concepts
ShammyIII Jan 6, 2026
1375eeb
Add new clinical concepts for maternal and neonatal care
petroskayange Jan 29, 2026
0f2fb3c
Replace outdated concepts with new admission and treatment-related co…
petroskayange Jan 29, 2026
b93f4fe
Merge pull request #855 from HISMalawi/fix_neo
dominickasanga Jan 29, 2026
d3b95b1
adding MNH new concept
petroskayange Jan 29, 2026
35cf8f2
Adding neonatal and MNH concepts
petroskayange Jan 30, 2026
6eb2ace
Merge pull request #856 from HISMalawi/fix_neo
KellsWorks Jan 30, 2026
257ffd3
Remove restriction on minimal demographics check for neonatal patients
petroskayange Jan 30, 2026
69fff10
Merge pull request #857 from HISMalawi/fix_neo
ShammyIII Jan 30, 2026
97762c9
Move record syncing logic to base sync job and trigger sync after pat…
petroskayange Feb 2, 2026
73a4242
adding missing neonatal concepts
petroskayange Feb 2, 2026
270e45d
Reorganize sync job structure and simplify patient record saving
petroskayange Feb 2, 2026
7b797b8
Improve sync completion logging and fix code formatting
petroskayange Feb 2, 2026
b1da4f7
Move record syncing logic to base sync job and trigger sync after pat…
petroskayange Feb 2, 2026
a2ba056
adding missing neonatal concepts
petroskayange Feb 2, 2026
3550be6
Reorganize sync job structure and simplify patient record saving
petroskayange Feb 2, 2026
7ebe309
Improve sync completion logging and fix code formatting
petroskayange Feb 2, 2026
439caca
Sync patient records to CouchDB after save
petroskayange Feb 2, 2026
83cb778
Merge pull request #860 from HISMalawi/fix_neo
dominickasanga Feb 2, 2026
8a53617
adding Normal (healthy and clean) concept
petroskayange Feb 3, 2026
335761e
Merge pull request #861 from HISMalawi/fix_neo
dominickasanga Feb 3, 2026
4ea82f9
Add endpoint to find relationships with detailed information
petroskayange Feb 3, 2026
e855f28
Update person relationships handling and add bulk relationship creation
petroskayange Feb 5, 2026
0ddfabf
adding missing OPD medication and neonatal concepts
petroskayange Feb 5, 2026
759b58f
Merge pull request #862 from HISMalawi/fix_neo
ShammyIII Feb 5, 2026
3211894
Improve relationship handling for patient guardians
petroskayange Feb 9, 2026
a3bf771
Add relationships handling to patient records and improve guardian da…
petroskayange Feb 10, 2026
0b838f4
Implement feature X to enhance user experience and fix bug Y in module Z
petroskayange Feb 10, 2026
c44d6ce
Merge pull request #863 from HISMalawi/fix_neo
dominickasanga Feb 10, 2026
a40bfb3
Update EMR API gem and implement printer configuration management wit…
petroskayange Feb 10, 2026
c1a0ce6
Merge pull request #864 from HISMalawi/fix_neo
dominickasanga Feb 10, 2026
cf7af3a
adding new concept and encounters
petroskayange Feb 11, 2026
4e2ae5d
Merge pull request #865 from HISMalawi/fix_neo
dominickasanga Feb 11, 2026
9765de9
adding missing diagnosis
petroskayange Feb 12, 2026
d7e5b5c
modified: app/services/build_patient_record_service.rb
dominickasanga Feb 12, 2026
ca994bd
modified: app/services/build_patient_record_service.rb
dominickasanga Feb 12, 2026
31dbc7b
adding neonatal missing concepts
petroskayange Feb 18, 2026
e2cbf2c
Merge pull request #866 from HISMalawi/fix_neo
ShammyIII Feb 18, 2026
4b3e63b
fix provider id
petroskayange Feb 19, 2026
d605ba9
Merge pull request #868 from HISMalawi/fix_neo
hopgausi Feb 19, 2026
c691f8c
fix provider id issues
petroskayange Feb 19, 2026
9811b81
Merge pull request #869 from HISMalawi/fix_neo
hopgausi Feb 19, 2026
313b04a
params
petroskayange Feb 19, 2026
8bb106d
Merge pull request #870 from HISMalawi/fix_neo
hopgausi Feb 19, 2026
606a88b
feature: added critical stats to use primary and diff diagnosis
KellsWorks Feb 20, 2026
a34a3a7
Merge pull request #871 from HISMalawi/feature/normalize-neonatal-stats
ShammyIII Feb 22, 2026
36a1f42
fix: use current user not provider when creating lab orders, twin sea…
KellsWorks Feb 24, 2026
af921a8
Merge pull request #872 from HISMalawi/fix/neonatal-testing-issues
ShammyIII Feb 24, 2026
deb331b
adding new concepts
petroskayange Feb 25, 2026
3d00144
Merge pull request #873 from HISMalawi/fix_neo
dominickasanga Feb 25, 2026
ce4cc78
new concepts
petroskayange Feb 26, 2026
5343840
Merge pull request #874 from HISMalawi/fix_neo
dominickasanga Feb 26, 2026
3fe36e1
new concepts
petroskayange Feb 26, 2026
5c7848a
refactor(build_patient_record_service): extract patient identifier logic
petroskayange Mar 1, 2026
47b4a01
new concept
petroskayange Mar 1, 2026
ebb0e82
Merge pull request #875 from HISMalawi/fix_neo
dominickasanga Mar 1, 2026
d9f498a
feat(api): add show action and location filtering to printer configur…
petroskayange Mar 2, 2026
4211580
Merge pull request #876 from HISMalawi/fix_neo
ShammyIII Mar 2, 2026
ba40018
adding new concepts
petroskayange Mar 2, 2026
840ca29
Merge pull request #877 from HISMalawi/fix_neo
KellsWorks Mar 2, 2026
6e66733
refactor(patient): streamline patient retrieval logic in CouchdbPatie…
petroskayange Mar 3, 2026
8a22960
Merge pull request #878 from HISMalawi/revert_find_patient
ShammyIII Mar 3, 2026
7c837f5
adding new role === District Superuser
petroskayange Mar 6, 2026
ebfae78
Merge pull request #879 from HISMalawi/fix_neo
ShammyIII Mar 6, 2026
9cf3fc3
adding new concepts
petroskayange Mar 9, 2026
e1fae22
Merge pull request #880 from HISMalawi/fix_neo
dominickasanga Mar 9, 2026
d576c95
feat(report): add dashboard_stats method to retrieve new and continui…
evance-mose Mar 7, 2026
5f00651
feat(dashboard): enhance dashboard_stats to include ultrasound scanni…
evance-mose Mar 7, 2026
3795980
feat(dashboard): add metrics for women with 4+ ANC contacts to dashbo…
evance-mose Mar 7, 2026
04410c8
feat(dashboard): add metrics for clients with previous uterine scars …
evance-mose Mar 7, 2026
c7bd60b
feat(dashboard): add HIV and syphilis testing metrics to dashboard_stats
evance-mose Mar 7, 2026
69668d1
refactor(dashboard): optimize metrics calculations and introduce cach…
evance-mose Mar 8, 2026
8c338ec
feat(report): add Labour Program report engine to report service
evance-mose Mar 8, 2026
99f3d74
feat(dashboard): add metrics for deliveries by skilled attendants and…
evance-mose Mar 8, 2026
2b34a11
feat(dashboard): include metrics for clients delivered at home or in …
evance-mose Mar 8, 2026
c67b801
feat(dashboard): add metrics for clients delivered at this facility a…
evance-mose Mar 8, 2026
d6404d3
feat(dashboard): introduce metrics for obstetric complications and en…
evance-mose Mar 8, 2026
fd4c6eb
feat(dashboard): add caesarean section metrics and enhance delivery s…
evance-mose Mar 8, 2026
96d6ed8
refactor(dashboard): remove legacy dashboard stats queries and integr…
evance-mose Mar 8, 2026
c18c574
fix(mnh_service): update labour program name to 'LABOUR AND DELIVERY …
evance-mose Mar 8, 2026
78e2bd0
feat(mnh_service): add PNC program support and update error handling …
evance-mose Mar 10, 2026
1b83aca
feat(mnh_service): add metrics for babies receiving Polio 0 and their…
evance-mose Mar 10, 2026
1187a20
feat(mnh_service): add metrics for mothers' HIV status and postnatal …
evance-mose Mar 10, 2026
c7be58f
feat(mnh_service): add metrics for mothers checked within seven days …
evance-mose Mar 10, 2026
487549a
feat(mnh_service): add metrics for women counselled on exclusive brea…
evance-mose Mar 10, 2026
6e84c44
feat(mnh_service): enhance labour statistics by adding total labour m…
evance-mose Mar 11, 2026
352149c
feat(patient-enrollment): enable program enrollment and support multi…
petroskayange Mar 16, 2026
bc12b34
adding new encounters
petroskayange Mar 17, 2026
46ad337
Merge pull request #882 from HISMalawi/fix_neo
petroskayange Mar 23, 2026
db4fee9
new concepts
petroskayange Mar 25, 2026
2244227
Merge pull request #883 from HISMalawi/fix_neo
KellsWorks Mar 25, 2026
545d6ec
feat(medication-order-saver): enhance medication order processing wit…
petroskayange Mar 31, 2026
b1011dd
feat(save-patient-record): add medication order data and treatment en…
petroskayange Mar 31, 2026
9b82334
Merge pull request #884 from HISMalawi/fix_neo
ShammyIII Mar 31, 2026
7a427c6
feat: enhance error handling and real-time updates in patient record …
petroskayange Apr 12, 2026
c6980a1
Merge pull request #885 from HISMalawi/web_socket
ShammyIII Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ db/lims_metadata/*.json

.solargraph.yml
.vscode
.idea
vendor_bk

# Ignore json files under hts_metadata
db/hts_metadata/*.json

# f bups
db/data/facilities/backups/

config/environments/development.rb
config/environments/production.rb
config/environments/test.rb
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
ruby = "3.2.0"
80 changes: 80 additions & 0 deletions Docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3.8'

services:
db:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: app_development
MYSQL_USER: app_user
MYSQL_PASSWORD: app_password
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
interval: 10s
timeout: 5s
retries: 5

redis:
image: redis:7.0
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5

app:
build: .
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3000:3000"
environment:
DATABASE_HOST: db
DATABASE_PORT: 3306
DATABASE_USERNAME: app_user
DATABASE_PASSWORD: app_password
DATABASE_NAME: app_development
REDIS_URL: redis://redis:6379/0
RAILS_ENV: development
ENABLE_SIDEKIQ: "true"
volumes:
- .:/app
- bundle_cache:/usr/local/bundle
command: rails server -b 0.0.0.0

sidekiq:
build: .
depends_on:
- app
- db
- redis
environment:
DATABASE_HOST: db
DATABASE_PORT: 3306
DATABASE_USERNAME: app_user
DATABASE_PASSWORD: app_password
DATABASE_NAME: app_development
REDIS_URL: redis://redis:6379/0
RAILS_ENV: development
volumes:
- .:/app
- bundle_cache:/usr/local/bundle
command: bundle exec sidekiq

volumes:
mysql_data:
redis_data:
bundle_cache:
81 changes: 81 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM ruby:3.2

# Set DNS to use Google's public DNS as a fallback
RUN echo "nameserver 8.8.8.8" >> /etc/resolv.conf

# Install dependencies with retry mechanism
RUN apt-get update -qq || (sleep 10 && apt-get update -qq) && \
apt-get install -y \
build-essential \
default-libmysqlclient-dev \
mariadb-client \
nodejs \
npm \
curl \
net-tools \
netcat \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install passenger
RUN gem install passenger

# Set up working directory
WORKDIR /app

# Copy Gemfile and Gemfile.lock
COPY Gemfile Gemfile.lock ./

# Install gems with retry
RUN bundle install || (gem install bundler && bundle install)

# Copy the rest of the application
COPY . .

# Expose port 3000
EXPOSE 3000

# Set environment variables
ENV RAILS_ENV=development
ENV RAILS_LOG_TO_STDOUT=true

# Install foreman to run multiple processes
RUN gem install foreman

# Create entrypoint script
RUN echo '#!/bin/bash\n\
set -e\n\
\n\
# Wait for MySQL to be ready\n\
if [ -n "$DATABASE_HOST" ]; then\n\
echo "Waiting for MySQL..."\n\
while ! nc -z $DATABASE_HOST ${DATABASE_PORT:-3306}; do\n\
sleep 1\n\
done\n\
echo "MySQL is up and running!"\n\
fi\n\
\n\
# Remove a potentially pre-existing server.pid for Rails\n\
rm -f tmp/pids/server.pid\n\
\n\
# Run database migrations if needed\n\
if [ "$RAILS_ENV" = "development" ] || [ "$RAILS_ENV" = "test" ]; then\n\
bundle exec rails db:create db:migrate 2>/dev/null || echo "Database migrations not needed"\n\
fi\n\
\n\
# Start Redis and Sidekiq in background if needed\n\
if [ "$ENABLE_SIDEKIQ" = "true" ]; then\n\
redis-server --daemonize yes\n\
bundle exec sidekiq -C config/sidekiq.yml &\n\
fi\n\
\n\
# Execute the main command\n\
exec "$@"' > /app/entrypoint.sh

RUN chmod +x /app/entrypoint.sh

# Set entry point
ENTRYPOINT ["/app/entrypoint.sh"]

# Start Rails server
CMD ["rails", "server", "-b", "0.0.0.0"]
31 changes: 22 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '~> 3.2.0'


# Gems for managing background jobs
gem 'sidekiq'
gem 'sidekiq-cron'
gem 'redis'
gem 'activejob-uniqueness'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.0.6'
# Use sqlite3 as the database for Active Record
Expand Down Expand Up @@ -42,30 +49,31 @@ gem 'rest-client'

gem 'test-unit'


gem 'rswag-api'
gem 'rswag-ui'

# gem 'emr_ohsp_interface', '~> 1.2'
# gem 'his_emr_api_lab', '~> 1.1.30'
# gem 'his_emr_api_radiology', '~> 0.0.8'
gem 'emr_ohsp_interface', '~> 2.2.5'

gem 'emr_ohsp_interface', '~> 2.2.3'
gem 'his_emr_api_lab', '~> 2.0.0'
gem 'his_emr_api_lab', '2.0.9.pre.mahis'

# gem 'emr_ohsp_interface', '~> 2.2.3'
# gem 'his_emr_api_lab', '~> 2.0.5'
# gem 'his_emr_api_radiology', '~> 1.0.9'

gem 'parallel', '~> 1.20.1'
gem 'time_difference'

gem "audited"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'spring'
end

group :test do
gem 'factory_bot_rails'
gem 'rspec'
gem 'rspec-rails'
gem 'rswag-specs'
gem 'spring'
end

group :development do
Expand All @@ -79,5 +87,10 @@ gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

gem 'whenever', '~> 1.0'

gem 'concurrent-ruby', '= 1.3.4'

# gems for reading excel and csv files
gem 'roo', '~> 2.8'

#gem for object matching
gem 'whitesimilarity'
Loading