I'm coming in late, so maybe you already have a solution. This should
help you create your prescriptions. I would create an array of
prescriptions (not in the code). Each prescription should be a structure
of patient info, doc info and an array of drug info.

<cfhttp url=""
        name="q1"
textqualifier=""""
delimiter=","/>
<cfquery dbtype="query" name="q2">
SELECT *
FROM q1
ORDER BY PMEDICARE, SDOCPRESNO
</cfquery>
<cfoutput query="q2" group="PMEDICARE">
  <cfoutput group="SDOCPRESNO">
    <cfset count = 1>
    <cfoutput>
      <cfif count MOD 3 IS 1>
        <!--- Do what you need to do to start a new prescription --->
      <cfelse>
        <!--- Add to current prescription --->
      </cfif>
      <cfset count = count + 1>
     </cfoutput>
  </cfoutput>
</cfoutput>

Prescription (struct):
- doctor (struct)
  - name (string)
  - ...
- patient (struct)
  - name (string)
  - ...
- drugs (array)
  1. (struct)
    - name (string)
    - ...
  2. (struct)
    - name (string)
    - ...

Pascal

> -----Original Message-----
> From: Brant Winter [mailto:[EMAIL PROTECTED]
> Sent: 21 September 2004 07:25
> To: CF-Talk
> Subject: Looping....again
>
> The hard part is:
>
>             Each structure / array of drugs making up a script can
only
> have
> 3 drugs on it, so I my patient has 5 drugs prescribed on that day I
need 2
> structures, one with 3 drugs on it, the other with 2.
>
> Can someone help me with the looping constructs ???
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to