Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wierd results from ResourceBase and ResourceIdentity #2795

Closed
LodewijkSioen opened this issue May 30, 2024 · 0 comments · Fixed by #2805
Closed

Wierd results from ResourceBase and ResourceIdentity #2795

LodewijkSioen opened this issue May 30, 2024 · 0 comments · Fixed by #2805

Comments

@LodewijkSioen
Copy link
Contributor

LodewijkSioen commented May 30, 2024

Describe the bug
Both the ResourceBase property and the ResourceIdentity extension method produce strange results

To Reproduce
The following code:

var client = new FhirClient("http://localhost:8080");
var patient = new Patient();

Console.WriteLine("Unsaved Patient");
Console.WriteLine(patient.ResourceBase);
Console.WriteLine(patient.ResourceIdentity());

Console.WriteLine("Saved Patient");
var newPatient = await client.CreateAsync(patient);
Console.WriteLine(newPatient.ResourceBase);
Console.WriteLine(newPatient.ResourceIdentity());

Console.WriteLine("Read Patient");
var patientGet = await client.ReadAsync<Patient>($"Patient/{newPatient.Id}");
Console.WriteLine(patientGet.ResourceBase);
Console.WriteLine(patientGet.ResourceIdentity());

Produces:

Unsaved Patient


Saved Patient
http://localhost:8080/Patient
http://localhost:8080/Patient/Patient/fc4a7d76-cf89-4513-8ae1-23cb4344e521/_history/1
Read Patient
http://localhost:8080/Patient/fc4a7d76-cf89-4513-8ae1-23cb4344e521
http://localhost:8080/Patient/fc4a7d76-cf89-4513-8ae1-23cb4344e521/Patient/fc4a7d76-cf89-4513-8ae1-23cb4344e521/_history/1

Expected behavior
I think ResourceBase should always return http://localhost:8080 in this case. That should fix ResourceIdentity

Version used:

  • Version: 5.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants