iyadsultan commited on
Commit
1e0ba61
·
1 Parent(s): 8102cc6
Files changed (3) hide show
  1. Dockerfile +8 -1
  2. app.py +3 -2
  3. data/documents.csv +4 -0
Dockerfile CHANGED
@@ -8,4 +8,11 @@ RUN pip install --no-cache-dir -r requirements.txt
8
  COPY . .
9
 
10
  # Make sure the app is accessible
11
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
8
  COPY . .
9
 
10
  # Make sure the app is accessible
11
+ CMD ["python", "app.py"]
12
+
13
+ # Add these lines to ensure proper permissions
14
+ RUN mkdir -p /data && \
15
+ chown -R 1000:1000 /data && \
16
+ chmod -R 755 /data
17
+
18
+ VOLUME /data
app.py CHANGED
@@ -46,7 +46,7 @@ NOTE_ORIGINS = [
46
  "I am not sure"
47
  ]
48
 
49
- DATA_DIR = os.environ.get('DATA_DIR', '.') # Gets from env or uses current directory
50
  ERROR_LOG = [] # Store recent errors for debugging
51
 
52
  def log_error(error_msg):
@@ -547,8 +547,9 @@ def reset():
547
  return redirect(url_for('index'))
548
 
549
  if __name__ == '__main__':
550
- # Create data directory if it doesn't exist
551
  os.makedirs(DATA_DIR, exist_ok=True)
 
552
 
553
  # Set debug mode for troubleshooting
554
  app.config['DEBUG'] = True
 
46
  "I am not sure"
47
  ]
48
 
49
+ DATA_DIR = os.environ.get('DATA_DIR', 'data') # Changed from '.' to 'data'
50
  ERROR_LOG = [] # Store recent errors for debugging
51
 
52
  def log_error(error_msg):
 
547
  return redirect(url_for('index'))
548
 
549
  if __name__ == '__main__':
550
+ # Create data directory if it doesn't exist with proper permissions
551
  os.makedirs(DATA_DIR, exist_ok=True)
552
+ os.chmod(DATA_DIR, 0o755) # Set directory permissions
553
 
554
  # Set debug mode for troubleshooting
555
  app.config['DEBUG'] = True
data/documents.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ filename,description,mrn,note
2
+ "progress_note_1.txt","Primary Care Follow-up Visit","MRN12345678","Patient is a 57-year-old male with history of hypertension, type 2 diabetes, and hyperlipidemia presenting for routine follow-up. BP today is 138/82, weight stable at 87kg. A1c improved from 7.8 to 7.2. Patient reports good medication adherence and states he is walking 30 minutes daily. Physical exam unremarkable. Assessment: 1) Hypertension - well controlled, continue current regimen 2) T2DM - improving, continue metformin 1000mg BID 3) Hyperlipidemia - LDL at goal, continue atorvastatin. Plan: Continue current medications, follow-up in 3 months, routine labs before next visit."
3
+ "ed_visit_note.txt","Emergency Department Visit for Chest Pain","MRN87654321","45-year-old female with no significant past medical history presents with sudden onset substernal chest pain that started 2 hours ago while at rest. Pain is 7/10, described as pressure-like, radiating to left arm, associated with mild SOB and nausea. Vitals: T 37.0, HR 102, BP 142/88, RR 18, SpO2 98% on RA. EKG shows NSR without ST changes. Initial troponin negative. CXR without acute findings. Patient given aspirin 325mg, sublingual nitroglycerin with relief of symptoms. Assessment: Acute chest pain, unclear etiology, low-intermediate risk for ACS. Plan: Admit to observation unit for serial troponins and stress test in AM."
4
+ "discharge_summary.txt","Hospital Discharge Summary - Pneumonia","MRN23456789","72-year-old male with COPD admitted for community-acquired pneumonia. Patient presented with 4 days of productive cough, fever, and worsening shortness of breath. CXR showed RLL infiltrate. Treated with IV ceftriaxone and azithromycin for 3 days with clinical improvement, then transitioned to oral antibiotics. O2 requirements decreased from 4L to baseline 2L. Pulmonary function optimized with scheduled bronchodilators. Discharged home on 7-day course of amoxicillin-clavulanate with pulmonology follow-up in 2 weeks. Patient educated on importance of pneumococcal and influenza vaccinations. Follow-up CXR recommended in 6 weeks to ensure resolution."