NetTalk Central

Author Topic: NT 12.19, trouble calling two API Clients  (Read 1394 times)

jking

  • Sr. Member
  • ****
  • Posts: 400
    • View Profile
    • Email
NT 12.19, trouble calling two API Clients
« on: August 07, 2021, 08:46:23 PM »
Hello everyone,

     I have a C11.0.13505 app that calls two NT 12.19 API Clients.  The main app is a simple window, that I will call on a schedule.  Upon opening it I call the following code:

Access:Pathology_MKD.Open()
Access:Pathology_MKD.UseFile()
Set(PatMKD:STUDYID_KEY)
LOOP
CASE Access:Pathology_MKD.Next()
OF Level:Benign
    If PatMKD:LIS_STATUS <> 'Success' 
        myURL = 'https://********/AustraliaStudy/api/Study?'&|
        'firstName='&Clip(PatMKD:FirstName)&|
        '&lastName='&Clip(PatMKD:LastName)&|
        '&DateOfBirth='&Format(PatMKD:DateOfBirth, @D02)&|       
        '&city='&Clip(PatMKD:SubjectCity)&|
        '&country='&Clip(PatMKD:SubjectCountry)

        LIS_GET_Proc_AUS(myURL)  !!API Client

    END
    Cycle
OF Level:Notify OROF Level:Fatal
    BREAK
END!Case
END!Loop
Access:Pathology_MKD.Close()


     The idea is to loop through the Pathology_MKD tps file and process records that do not have "Success" in the LIS_Status field.  If LIS_Status is blank, I construct a URL and pass this as a parameter to the first API Client procedure called LIS_GET_Proc_AUS(myURL).  If this API returns a result field of "Success", that is data is returned, then a Study_ID string is passed to another API Client called EDC_POST_Proc_AUS.  Note this second API is called from within the first API Client code.  The two API clients do seem to communicate as I get 2-4 records processed, but no more.  In my test scenario, there are 10 records in the Pathology_MKD file that should be processed.  Any thoughts as to the problem...not processing all 10 records?  Timing issue?  My loop logic is incorrect?

Thanks,

Jeff King










jking

  • Sr. Member
  • ****
  • Posts: 400
    • View Profile
    • Email
Solved - Re: NT 12.19, trouble calling two API Clients
« Reply #1 on: August 08, 2021, 07:45:59 AM »
     I found that in the second API Client I was using a Set(File, Key) before doing a Fetch.  Removing the Set fixed my issue.

Thanks,

Jeff