Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21273

Dropping header from empty section

$
0
0
The program i have written arranges information into sections for display.

Sometimes there is no information to display in a section

hopw do i get it to not print the header line for the section of there is no data to put in it?

example:
Code:

Print #2, "<i>---History, Diagnoses, Symptoms</i>"
Open "c:\test\HDS.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, LineOfText
    If Mid(LineOfText, 63, 1) = "B" Then
    Print #2, Mid(LineOfText, 1, 62); "                "; Mid(LineOfText, 65, 5)
    End If
Loop
Close #1

Print #2, "<i>---Physical Exam</i>"
Open "a:\phys.txt" For Input As #1

        Print #2, "<table width=100% align=center>"

Do While Not EOF(1)
    Line Input #1, LineOfText
    If Mid(LineOfText, 1, 1) = "B" Then
Print #2, Mid(LineOfText, 79, 8); "&nbsp"; Mid(LineOfText, 11, 68); Mid(LineOfText, 87, 7)
    End If

Loop
Print #2, "</table>"
Close #1


Print #2, "<i>---Vital Signs</i>"
Open "a:\vsigns.txt" For Input As #1
Do While Not EOF(1)
    Line Input #1, LineOfText
    If Mid(LineOfText, 1, 1) = "B" Then
    Print #2, Mid(LineOfText, 2)
    End If

Loop
Print #2, "</table>"
Close #1


Open "v:\" & udtInfo.id & "\pageone.txt" For Random As #1
Get #1, , dateofservice
Close #1
Print #2, "<i>---Laboratory Trends on</i>"; "&nbsp"; Mid(dateofservice, 33, 8)
Open "v:\" & udtInfo.id & "\pageone.txt" For Input As #1
Do While Not EOF(1)
    Line Input #1, LineOfText
    If Mid(LineOfText, 1, 1) = "B" Then
    Print #2, Mid(LineOfText, 3)
    End If
Loop
Close #1
Print #2, "</table>"

Print #2, "<i>---Labratory Tests performed today</i>"

Print #2, "<i>---Laboratory & Procedures Ordered Today</i>"
Open "c:\test\output.txt" For Input As #1
Do While Not EOF(1)
    Line Input #1, LineOfText
    If Mid(Trim(LineOfText), 1, 1) = "B" Then
 Print #2, Format$(Date, "mm-dd-yyyy"); Mid(Trim(LineOfText), 2)
    End If

Loop
Print #2, "</table>"
Close #1

Print #2, "<i>---Prescriptions</i>"
Open "c:\test\scripts.txt" For Input As #1
Do Until EOF(1)
    Line Input #1, LineOfText
    If Mid(LineOfText, 63, 1) = "B" Then
    Print #2, Mid(LineOfText, 1, 60); "                  "; Mid(LineOfText, 65, 6)
    End If

Loop
Close #1

prints
HTML Code:

HIV --------------------------------------------------------------------------------
---History, Diagnoses, Symptoms
01-05-10 . FAMILY HISTORY-SON                        01-05-10                     
03-08-10 . HIV TESTING                              03-08-10                V72.6
---Physical Exam

---Vital Signs

---Laboratory Trends on 11-11-11

---Labratory Tests performed today
---Laboratory & Procedures Ordered Today
03-12-2013 >HIV 1 WESTERN BLOT determines exposure to HIV 1.\
03-12-2013 >HIV-1 GENOTYPE WITH TROPISM assists in selection of HIV medication.\
03-12-2013 >DAILY NEBUPENT 300 MG VIA AEROSOL was given for PCP TREATMENT\
03-12-2013 >INTRAVENOUS CHEMOTHERAPY was given for KAPOSI'S SARCOMA\

---Prescriptions

i want it to not print the blank sections such as labratory trends or vital signs if they have no data

there may be data in these sections for other patients and if there is data they should then print

Viewing all articles
Browse latest Browse all 21273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>