FHIR Chat · Adding custom tabs to IG profile · IG creation

Stream: IG creation

Topic: Adding custom tabs to IG profile


view this post on Zulip Vaibhav Kumbhar (Jun 21 2021 at 10:20):

Hi, I'm extending the FHIR IG base template https://github.com/HL7/ig-template-base for adding custom tabs on profile page like Operations, Error Codes, Search Parameters. I found a way to add tabs, but for specific page generation, I'm not able to find the logic e.g. generate patient.operations.html page. Can someone guide me on how exactly that template is generated from those scripts. I am not able to find the starting point. image.png

view this post on Zulip Jose Costa Teixeira (Jun 21 2021 at 14:29):

How are you adding tabs (just to see where you are right now)?

view this post on Zulip Vaibhav Kumbhar (Jun 21 2021 at 16:14):

Jose Costa Teixeira said:

How are you adding tabs (just to see where you are right now)?

I am extending this template --> https://github.com/HL7/ig-template-base . In that includes/ fragment-profile-navtabs.html I have added tabs by adding below code(for reference).
{% unless sd_type == 'Extension' %}
{% if include.active == 'operations' %}
<li class="active">
<a href="#">Operations</a>
</li>
{% else %}
<li>
<a href="{{include.type}}-{{include.id}}-operations.html">Operations</a>
</li>
{% endif %}
{% endunless %}

I'm also able to produce the specific pages for operations, Sps (Duplicated template config which was present for adding examples).
Currently, Figuring out how can add profile specific data to the page. Also, I still don't understand how this is working internally ( Need to figure this out).

view this post on Zulip Max Masnick (Jun 21 2021 at 18:09):

I am not recommending this as a good practice, but if you really want to you can do this with JavaScript:

<script>
document.addEventListener("DOMContentLoaded", function() {
  $('<li><a href="example.html">Examples</a></li>').insertAfter('.nav-tabs li.active');
});
</script>

view this post on Zulip Max Masnick (Jun 21 2021 at 18:10):

Again, this is probabaly a terrible idea for maintainability and accessability reasons.

view this post on Zulip Lloyd McKenzie (Jun 25 2021 at 03:09):

I'm trying to understand how you could have operations or search parameters that are profile-specific given that there can be multiple profiles for one resource and operations and search are at the resource level, not the profile level. There's certainly no standard publisher function that would generate such a function - you'd have to write code to do it yourself. (And given that your template is untrusted, that would mean you couldn't use HL7's continuous integration build site - if that matters to you.)


Last updated: Apr 12 2022 at 19:14 UTC