> Dave - I assumed it would involve some complex looping to work out which
> drugs below to the same patient on the same day etc etc.
>
> I am using the following code to generate a query object from the CSV
> file:
>
> <cfhttp url="" name="qGetData" method="GET"
> timeout="20" delimiter="," textqualifier=""""></cfhttp>
Brant,
I think like Dave says - you're going at this BAB... Don't try and
create seperate structs and arrays for all this data, just leave it in
your query, but reorder the data using QofQ into something that helps
with the output.
<cfquery name="sortedPatients" dbtype="query">
SELECT * FROM qGetData
ORDER BY Medicare, LastName, FirstName
</cfquery>
Then you have a straight loop of medication by patient and all you have
to do is split them into scripts.
<cfset prevmedicare = 0>
<cfset medcount = 0>
<CFLOOP QUERY="sortedPatients">
<cfif prevmedicare neq sortedPatients.medicare>
<cfif sortedPatients.currentrow NEQ 1>
<!--- Output script Footer, if I'm not on the first record --->
</cfif>
<!--- new patient --->
<cfset medcount = 0>
<cfset prevMedicare = sortedPatients.medicare>
<!--- Output scriptheader --->
</cfif>
<cfif variables.medcount eq 3>
<cfset medcount = 0>
<!--- Output the footer of script --->
<!--- Output the header of next script for this patient --->
</cfif>
<!--- Output single row of the script --->
<cfset medcount = IncrementValue(medcount)>
<cfif sortedPatient.recordcount eq sortedPatient.currentrow>
<!--- See if this is the last record and output a script footer if
it is --->
</cfif>
</CFLOOP>
Clear as mud??
Stephen
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

