Public/Remove-CdrResource.ps1

function Remove-CdrResource {
    param(
        [ValidateSet('Patient','Practitioner','RelatedPerson','Coverage')]
        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [String]$Type,

        [Parameter(Mandatory=$true)]
        [ValidateNotNullOrEmpty()]
        [String]$Id
    )

    $iamAuthenticate = Invoke-IamAuthenticate
    $fhirUrl = "$((Get-SfConfig).phecc__FHIRURL__c)/$($Type)/$($Id)"
    $headers = @{
        "Connection"="keep-alive"
        "api-version"="2"
        "Authorization"="Bearer $($iamAuthenticate.access_token)"
        "Content-Type"="application/x-www-form-urlencoded; charset=UTF-8"
    }
    Invoke-RestMethod -Uri $fhirUrl -Method Delete -Headers $headers
}