NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jking

Pages: 1 2 [3] 4 5 ... 27
31
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 06, 2024, 08:02:17 AM »
Hi Ron,

     I have tried a number of the embeds but still don't know exactly how to "jump out" before the Insert.  It is true, I'm using the "built in" action of Insert.  This particular API will only do Inserts but I want to conditionally do the Insert based on the presence of a valid Institution ID in a lookup of our list of institutions.
     I may be wrong but I thought using the p_web.AddServiceError to set an error message was a way to jump out of doing the Insert, but this has not worked for me. 

Stay Tuned!

Jeff

32
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 05, 2024, 06:41:21 PM »
Hi Bruce,

     I'm confused by what you mean by client side auto-numbering.  This is an API that a "client" custom app will access.  This API has been added to an existing NT 14.13 server app we have had running for a few years.  The NT app does auto-numbering on a single field, the Patient_ID, on Inserts.  So I guess this would be server-side auto-numbering.

     However, based on Ron's recent post (Thanks Ron!), I changed my code.  I now have the following in the InsertRecordBeforeAdd embed of the InsertRecord:PatientEnrollment routine (NetWebServiceMethod):

    Ins:Institution_ID = Enr:Institution_ID
    If Access:Institution.Fetch(Ins:InstID_key) = Level:Benign
        Access:PatientEnrollment.PrimeAutoInc()
        Enr:Study_ID = 'Z'&Enr:Institution_ID&'-'&Enr:Patient_ID
    ELSE
        PatientEnrollment_Action = 'null'
        p_web.AddServiceError(999, '', '', 'Inst ID Not found', '')
    END

The use of the PrimeAutoInc() seems to have solved my auto-numbering issue.  I no longer have any code in the ServiceMethod routine embed.

     As you can see, I'm using the AddServiceError() in the ELSE statement above, as you hinted at in the previous post.  This does indeed send an error message as a result, when the passed Institution_ID is not valid.  However, a record is still created in the target tps file, PatientEnrollment.  This is the last issue I'm trying to solve.  A record should not be created in PatientEnrollment if there is not a valid Institution_ID in the Institution tps file.

     I thought I might be able to programmatically set the PatientEnrollment_Action variable, as seen in my code above.  So far this has not worked. 

Thanks,

Jeff

33
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 05, 2024, 12:23:29 PM »
Hi Bruce,

     I've been on that "fishing trip" you recommended.  The following code is what I have come up with.  It is in the ServiceMethod Routine embed:


 Ins:Institution_ID = Enr:Institution_ID
 If Access:Institution.Fetch(Ins:InstID_key) = Level:Benign
    Set(Enr:PatID_key, Enr:PatID_key)
    Access:PatientEnrollment.Fetch(Enr:PatID_key)
    Enr:Study_ID = 'Z'&Enr:Institution_ID&'-'&Enr:Patient_ID
    Access:PatientEnrollment.Update()
 ELSE
    Access:PatientEnrollment.DeleteRecord(0)
    p_web.AddServiceError(999, '', '', 'Inst ID Not found', '')
 END


     To explain, the main goal is to use the API to do an insert on the PatientEnrollment table, and generate the Enr:Study_ID, which is passed back to the client. 

     The main problem here is the Enr:Patient_ID has an autoincrement key.  It seems the new autoincremented value of the Enr:Patient_ID is not available quickly enough during an insert, so it can be used in the construction of the Enr:Study_ID field. 

     For example, I set the passed in Enr:Institution_ID to 66, which is a valid ID in my test data, and the last Enr:Patient_ID is 1234.  After a successful Insert, I would expect the Enr:Study_ID to be:   Z66-1235.  However I get Z66-0.  Note that the insert seems to have autoincremented the Patient_ID properly as the correct value of 1235 is found in the PatientEnrollment table.

     So, my solution was to allow this partial record...that is a partial Study_ID...to be inserted and then I immediately open this record and update it with the properly constructed Study_ID.

     The other problem I found is,  when I pass an invalid Institution_ID, the API does return the proper error message I set in the above code.  However, the API still inserts a PatientEnrollment table record for this invalid Institution_ID.  I have not been able to conditionally prevent the insert, so again I delete the invalid record after the insert.

     To summarize, I'm still looking for a solution to get the next auto-incremented value of Patient_ID sooner.  Also, looking for a way to conditionally prevent the insert when the passed institution_ID is invalid.  My current solution of updating and deleting does give me the final results I'm looking for but it does seem a bit messy.

Thanks,

Jeff

34
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 01, 2024, 04:06:40 PM »
Hi Bruce,

     The user asked me to try something.  In my EDC_Enrollment API method, I allow the user to do an insert into the Enrollment tps file.  Is there a way to make this conditional?  For example, they will pass an InstitutionID and I will do a lookup into the Institution tps file to see if it is valid.  I thought I might do this lookup in the InsertRecord:PatientEnrollment, Before Add embed.  See the attached image.  If the InstitutionID is not found, how can I stop the Insert action and send back an error message about the InstitutionID not being found?

Thanks,

Jeff

35
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 01, 2024, 01:36:41 PM »
Hi Bruce,

     I have made quite a bit of progress with this.  My user will be coding the call to the API into their own application.  I'm stuck on one issue here.  I have a user file to check on valid users.  What if they use the header like "Authorization: Basic ZGVtbzpkZW1v", to pass the username and password.  Does NT resolve this for me or do I need to decode this in the Webhandler Authenticate embed?

Thanks,

Jeff

36
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: January 30, 2024, 09:20:00 AM »
Bruce,

     Found the registration at the top of the ClarionLive site.  I'll try to join on Thursday.

Jeff

37
Web Server - Ask For Help / Help with NT 14.13 API
« on: January 29, 2024, 02:39:32 PM »
Hello,

     I'm having trouble getting started with a new API in my NT 14.13 app.  A laboratory will build an API on their end, and send an Institution ID (eg. S01) to my app.  I want my API to take this Institution ID and do a lookup into an Institution.tps file on my server. 

     If the Institution ID is found, I want to call an Insert to create a new record in an Enrollment.tps file.  During the insert and creation of a new record, a Study ID field will be created from the Institution ID and an autoincrementing field called Patient ID.  The Study ID, for example, would be something like S01-0001.  If a record is successfully created with this new Study ID, the Study ID then needs to be sent back to the client API.

     If the Institution ID is not found, then an error message must be sent back to the Client API.

     I have added a API service and method to my app but I'm struggling on what do add to the General, Parameters and Return tabs on the API Method template.  Can anyone provide me with some steps on how to proceed?

Thanks,

Jeff King

38
Hi Bruce,

     I have looked at the source and I can see where the condition appears in the code.  See attached image.  However, rather than conditionally hide a menu item, I want to just conditionally disable it.  That is, allow the text of the menu item to remain visible, greyed out, and not clickable.  A post from a few years ago mentioned it was not possible to disable a TaskPanel menu item yet, so I was wondering if this is something planned for a future update or a way to do this now?

Thanks,

Jeff

39
Hi Jane and Bruce,

     This project was on hold for about 2 years, now I'm back on it.  I know there is a template option to add a condition to include menu items but would rather disable menu items conditionally.  Is this possible yet?

Thanks,

Jeff

40
Web Server - Ask For Help / NT 14.13 Host exe app issue
« on: January 05, 2024, 05:41:00 PM »
Hello Bruce,

     I'm having a bit of trouble with the host.exe app (C11.1.13855 and NT 14.13).  I have it loaded into a Compile Manager app created by Handy Tools.  The Compile Manager indicates a build error with the following message:

--------------------------------------
ERROR: Invalid syntax. Default option is not allowed more than '1' time(s).
Type "TIMEOUT /?" for usage.
---------------------------------------

Is there anywhere in the Host EXE, or other NT 14.13 apps, that deals with DOS batch files and uses the "TIMEOUT /?" command? 

Note, the Host EXE does actually get compiled properly, as do all my other NT apps, I have in the Compile Manager.  It's just that the Compile Manager app indicates a failed build when in fact the build did succeed.  Gus at Handy Tools thinks it is due to the Host EXE using a DOS batch file somewhere.  Any thoughts on this?

Thanks,

Jeff





41
Web Server - Ask For Help / Re: NT 14.04, Web19 example app issue
« on: November 23, 2023, 04:36:33 AM »
Bruce,

     Me, of course!

Jeff

42
Web Server - Ask For Help / Re: NT 14.04, Web19 example app issue
« on: November 22, 2023, 09:15:56 AM »
I guess you CAN teach an old dog new tricks!

Jeff

43
Web Server - Ask For Help / Re: NT 14.04, Web19 example app issue
« on: November 21, 2023, 09:23:01 AM »
Bruce,

     I think you mean the Page Settings on the General Tab, where you tick on Include Std Header and Include Std Footer.  Is this correct? 

Jeff

44
Web Server - Ask For Help / Re: NT 14.04, Web19 example app issue
« on: November 20, 2023, 11:08:40 AM »
Bruce,

     Thanks!  I did not know ClaNetL means "local mode".  Learned something new today!

     As for the Index page being "thin", I added the following to the XHTML tab:

<!-- Net:PageHeaderTag -->
<!-- Net:PageFooterTag -->

Now the Index page is "fat".

Jeff

45
Web Server - Ask For Help / NT 14.04, Web19 example app issue
« on: November 17, 2023, 05:10:15 PM »
Hi Bruce,

     I'm trying to look at the Web19 example app.  I get it compiled but when I run it and use a local browser (127.0.0.1:88) to view it, I see the screen in the attached image web19 server.png.  There is very little code generated when viewing the page source.  In the app itself, the only odd thing I see is it appears to be linking in ClaNetl.lib, as seen in the attached image web19 lib.png.  Is this linking in the "Legacy" version of the NT templates?
     Other example apps and my own production apps link in ClaNet.lib.  Any suggestions about what is wrong here and how to fix?

Thanks,

Jeff King

Pages: 1 2 [3] 4 5 ... 27