Skip to content

Instantly share code, notes, and snippets.

Avatar

Christiaan Knaap cknaap

View GitHub Profile
@cknaap
cknaap / VonSessionsAMS2019.md
Last active Nov 20, 2019
Links for Vonk sessions FHIR DevDays 2019 Amsterdam
View VonSessionsAMS2019.md

Links

These are the links accompanying the session "Let's Build - Vonk Plugins" and "Let's Build - Vonk FHIR Facade" at FHIR DevDays 2019 Amsterdam.

@cknaap
cknaap / DD_Vonk_Plugins.md
Last active Jun 10, 2019
Links for the presentation on Extending Vonk FHIR Server at DevDays
View DD_Vonk_Plugins.md

Links

These are the links accompanying the session "Let's Build - Extending Vonk FHIR Server" at DevDays.

More background on Vonk

@cknaap
cknaap / VonkAuthorizationMiddleware.cs
Last active Aug 22, 2022
Middleware for custom authorization in Vonk FHIR Server
View VonkAuthorizationMiddleware.cs
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Vonk.Core.Context;
using Vonk.Core.Context.VonkContext;
using Vonk.Core.Support;
@cknaap
cknaap / FhirPatchComments.md
Last active Oct 30, 2018
Remarks on FhirPatch found while implementing it
View FhirPatchComments.md

I have implemented FHIRPath Patch on top of the .NET FHIR API. I have used the tests provided as download in the specification as unittests. The "Quoted Names" refer to the names of those tests.

  1. "Full Resource": would have expected valueXhtml for the new div instead of valueString. Now with valueString the actual types of the input div and the replacement div are different (xhtml vs string). But valueXhtml is not accepted, at least not by the .NET API.

  2. "Add Anonymous type": structure with nested parts feels clumsy and was very hard to get parsed correctly. No other way?

  3. What happens if sequential patches interact?

    1. For Delete:
      • array [0,1,2,3,4]
  • delete array[0]
@cknaap
cknaap / ElementDefaultMissing.md
Last active Jan 31, 2018
Evaluation of :missing modifier and default values in FHIR Elements
View ElementDefaultMissing.md

Trying to answer FHIR-I tracker items 13224, 13339 and 13348 the working group suggested to outline all possible combinations and work out their meaning.

The general rules we came to during the Mon Q2 session at WGM Jan 2018 were:

  1. An element with a default value is considered to have that value if element is not present
  2. An element without an element.value but with element.extension.count > 0 is NOT missing
  3. An element with a default value is never a match for a search with modifier :missing=true, and IS a match for :missing=false
  4. SUBSETTED and REDACTED tags:
  • SUBSETTED meaning: Elements have been withheld from the response in accordance with the clients request.
View Vonk.Facade.Starter.MapPatient.cs
public IResource MapPatient(ViSiPatient source)
{
var patient = new Patient();
patient.Id = source.Id.ToString();
patient.Identifier.Add(new Identifier("http://mycompany.org/patientnumber", source.PatientNumber));
patient.Name.Add(new HumanName().WithGiven(source.FirstName).AndFamily(source.FamilyName));
patient.BirthDate = new FhirDateTime(source.DateOfBirth).ToString();
patient.Telecom.Add(new ContactPoint(ContactPoint.ContactPointSystem.Email, ContactPoint.ContactPointUse.Home, source.EmailAddress));
return patient.AsIResource();
}
@cknaap
cknaap / ExpectedCallFromMemberData.cs
Created Dec 13, 2016
How to express an expected call on a Moq mock in the memberdata for an XUnit Theory.
View ExpectedCallFromMemberData.cs
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Moq;
using Xunit;
namespace DynamicVerify
{
public class ExpectedCallFromMemberData
{
@cknaap
cknaap / SimpleLogCheck.cs
Last active Dec 17, 2021
Easily check ILogger<T> interactions with ASP.NET Core Logging and Moq
View SimpleLogCheck.cs
using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace Knaap.Utilties
{