Skip to content

Instantly share code, notes, and snippets.

View prb112's full-sized avatar

Paul Bastide prb112

View GitHub Profile
@prb112
prb112 / imagestream-sets-schedule.sh
Last active April 2, 2024 18:49
patches the imagstreams in the namespace so they are scheduled per imagestream-sets-schedule
### Updated Script to Fix scheduled = false or null
for NAMESPACE_IMAGESTREAM in $(oc get imagestreams -A -ojson | jq -r '.items[] | select(.spec.tags[]? | select(.from.kind != "ImageStreamTag" and (.importPolicy.scheduled == null or .importPolicy.scheduled == false))) | "\(.metadata.namespace),\(.metadata.name)"')
do
NAMESPACE=$(echo ${NAMESPACE_IMAGESTREAM} | awk -F',' '{print $1}')
IMAGESTREAM=$(echo ${NAMESPACE_IMAGESTREAM} | awk -F',' '{print $2}')
echo "Processing ${NAMESPACE} imagestream/${IMAGESTREAM}"
IDX=0
for TAG in $(oc get imagestream -n ${NAMESPACE} ${IMAGESTREAM} -ojson | jq -r '.spec.tags[].name')
package main
import (
"fmt"
)
// List represents a singly-linked list that holds
// values of any type.
type List[T any] struct {
next *List[T]
@prb112
prb112 / IBM FHIR Server - Composition-$document.postman_collection.json
Last active August 27, 2021 14:25
Demo postman for Composition/$document - update the Authorization and the SERVER_HOSTNAME variable.
{
"info": {
"_postman_id": "6c0a89ea-117d-4d1a-a323-655832225d62",
"name": "IBM FHIR Server - Composition/$document",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "PREP - Create Practitioner",
"event": [
@prb112
prb112 / Main.java
Last active May 4, 2021 18:02
Example fhir-paths for extracting specific data
/*
* (C) Copyright IBM Corp. 2021
*
* SPDX-License-Identifier: Apache-2.0
*/
package demo;
import static com.ibm.fhir.model.type.String.string;
@prb112
prb112 / IBM FHIR Server - Examples and Follium.ipynb
Last active November 23, 2020 15:10
This demo shows how to use the IBM FHIR Server Docker image along with the IBM FHIR Server examples and `near` search parameter.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@prb112
prb112 / Encounter-Example.json
Created August 6, 2020 18:31
iff and between example for FHIRPath
{
"resourceType": "Encounter",
"id": "f203",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: f203</p><p><b>identifier</b>: Encounter_Roel_20130311 (TEMP)</p><p><b>status</b>: finished</p><h3>StatusHistories</h3><table><tr><td>-</td><td><b>Status</b></td><td><b>Period</b></td></tr><tr><td>*</td><td>arrived</td><td>08/03/2013 --&gt; (ongoing)</td></tr></table><p><b>class</b>: inpatient encounter (Details: http://terminology.hl7.org/CodeSystem/v3-ActCode code IMP = 'inpatient encounter', stated as 'inpatient encounter')</p><p><b>type</b>: Inpatient stay for nine days <span>(Details : {SNOMED CT code '183807002' = 'Inpatient stay 9 days', given as 'Inpatient stay for nine days'})</span></p><p><b>priority</b>: High priority <span>(Details : {SNOMED CT code '394849002' = 'High priority', given as 'High priority'})</span></p><p><b>subject</b>: <a>Roel</a></p><p><b>episodeOfCare</b>: <a>EpisodeOfCare/example
@prb112
prb112 / jq-fu-code-type-duplicate-code.sh
Created May 27, 2020 15:15
select same code and type
$ for VALUE in `cat ./fhir-registry/definitions/search-parameters.json | jq -r '.entry[].resource | "\(.code),\(.type)"' | sort -u`
> do
> CUR_VALUE=`echo "${VALUE}" | sed 's|,| |g' | awk '{print $1}'`
> PRE_VALUE=`echo "${PREVIOUS_VALUE}" | sed 's|,| |g' | awk '{print $1}'`
> if [ "$PRE_VALUE" = "$CUR_VALUE" ]
> then
> echo "${VALUE}"
> echo "${PREVIOUS_VALUE}"
> fi
> PREVIOUS_VALUE=${VALUE}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.3">
<description></description>
<groupId>1aee98d5-0172-1000-7a2d-00d37a42e7da</groupId>
<name>Fhir Metadata Flow</name>
<snippet>
<connections>
<id>7fc1990d-d604-370e-0000-000000000000</id>
<parentGroupId>d7051a5f-6d05-30ab-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
package test;
public Test {
// TODO add an implementation.
}
@prb112
prb112 / pom.xml
Last active April 6, 2020 00:12
Shading to use with a new model
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>resource-model-old</artifactId>
<version>3.0.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>