BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
khandelwalanmol
Fluorite | Level 6

I am attempting to kickstart a job on an API.  I am able to get a valid response without sending the _since parameter in the below curl command.

curl -X GET 'https://api.bcda.cms.gov/api/v1/Patient/$export?&_since=2020-02-13T08:00:00.000-05:00' \
	-H "Accept: application/fhir+json" \
	-H "Prefer: respond-async" \
	-H "Authorization: Bearer {access_token}"

Here is my Proc http procedure, alos i have tried passing the _since parameter using IN but no success.

Link for API documentation:https://bcda.cms.gov/build.html#requesting-since-with-Patient

	proc http         		
			url="https://api.bcda.cms.gov/api/v1/Patient/$export"         
         	out=jobresp
        	method="GET"
         	headerout =jobhead;
            headers "Accept"="application/fhir+json"
        			"Prefer"="respond-async"
        			"Authorization"="Bearer &access_token. ";
		run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Do you have a working curl command or not?  Your text says you were able to use curl without SINCE parameter, but your example CURL command syntax appears to have the &_since= in the URL.  And your example SAS code does NOT have that parameter.

 

If you want to pass a URL with &_since in it then quote the string using single quotes to prevent the macro processor from trying to evaluate &_SINCE as a reference to a macro variable.

 

proc http         		
  url='https://api.bcda.cms.gov/api/v1/Patient/$export?&_since=2020-02-13T08:00:00.000-05:00'
  out=jobresp
  method="GET"
  headerout =jobhead
;
  headers
    "Accept"="application/fhir+json"
    "Prefer"="respond-async"
    "Authorization"="Bearer &access_token."
  ;
run;

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

Do you have a working curl command or not?  Your text says you were able to use curl without SINCE parameter, but your example CURL command syntax appears to have the &_since= in the URL.  And your example SAS code does NOT have that parameter.

 

If you want to pass a URL with &_since in it then quote the string using single quotes to prevent the macro processor from trying to evaluate &_SINCE as a reference to a macro variable.

 

proc http         		
  url='https://api.bcda.cms.gov/api/v1/Patient/$export?&_since=2020-02-13T08:00:00.000-05:00'
  out=jobresp
  method="GET"
  headerout =jobhead
;
  headers
    "Accept"="application/fhir+json"
    "Prefer"="respond-async"
    "Authorization"="Bearer &access_token."
  ;
run;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 581 views
  • 0 likes
  • 2 in conversation